瀏覽代碼

reduce retry

Shawn Lu 1 年之前
父節點
當前提交
6024f91fbe
共有 1 個文件被更改,包括 9 次插入13 次删除
  1. 9 13
      src/faucet/faucet.ts

+ 9 - 13
src/faucet/faucet.ts

@@ -79,7 +79,7 @@ async function faucetLunch(concurrency: number = 8) {
         account.xrpPrivateKey = xrpl.Wallet.generate().seed
       if (!account.duid) account.duid = uuidv4().toUpperCase()
       await polly()
-        .waitAndRetry(3)
+        .waitAndRetry(2)
         .executeForPromise(async () => {
           const key = new MnemonicKey({ mnemonic: account.mnemonic })
           const evmWallet = new ethers.Wallet(key.privateKey.toString('hex'))
@@ -120,18 +120,14 @@ async function faucetLunch(concurrency: number = 8) {
             },
           )
           console.log(`${index}: register done`)
-          try {
-            const airdropResp = await client.post(
-              'https://api.lunchlunch.xyz/v1/dish/submit-action/airdrop',
-              {
-                dishId: 42,
-              },
-            )
-            console.log(`${index}: airdrop done`)
-          } catch (e) {
-            console.log('airdrop failed', e)
-            throw e
-          }
+
+          const airdropResp = await client.post(
+            'https://api.lunchlunch.xyz/v1/dish/submit-action/airdrop',
+            {
+              dishId: 42,
+            },
+          )
+          console.log(`${index}: airdrop done`)
         })
       await DBClient.instance.account.update({
         where: { id: account.id },