hel 1 year ago
parent
commit
7ea99c7197
2 changed files with 10 additions and 1 deletions
  1. 1 0
      src/onchain/finalTask.ts
  2. 9 1
      src/onchain/week3/randomWeek3.ts

+ 1 - 0
src/onchain/finalTask.ts

@@ -24,6 +24,7 @@ async function startCheck(concurrency) {
           data: { status: -2 },
           //可能领过还没到账的
         })
+        return
       }
       const done = await client.feedJennie()
       if (done == `done`) {

+ 9 - 1
src/onchain/week3/randomWeek3.ts

@@ -49,6 +49,14 @@ async function startCheck(concurrency) {
       const randomPick = notDone[Math.floor(Math.random() * notDone.length)]
 
       const client = new InitiaClient(account.mnemonic, true)
+      const gasGot = await client.gasGot()
+      if (!gasGot) {
+        await DBClient.instance.randomTask2.update({
+          where: { id: account.id },
+          data: { finish: -1 },
+        })
+        return
+      }
       if (randomPick === 1) {
         console.log(`task1`)
         const bool = await client.newBridge2BlackWings()
@@ -118,4 +126,4 @@ async function startCheck(concurrency) {
   })
 }
 
-startCheck(200)
+startCheck(50)