Browse Source

增加重试成功log

DevYK 3 years ago
parent
commit
33040ccd82
1 changed files with 5 additions and 1 deletions
  1. 5 1
      model/moralis_sdk.js

+ 5 - 1
model/moralis_sdk.js

@@ -188,6 +188,10 @@ async function getAccountBalances(options) {
                 result = await Moralis.Web3API.account.getTokenBalances(options);
                 logger.log('getTokenBalances=', result);
             }
+            if(tryCount < 4)
+            {
+                logger.error('getBalances succeed:', JSON.stringify(options), " 已重试:" + tryCount +"次")
+            }
             break
         } catch (error) {
             if (tryCount == 1) {
@@ -197,7 +201,7 @@ async function getAccountBalances(options) {
             tryCount -= 1;
             await utils.sleep(delay)
             delay += interval
-            logger.error('getBalances error:', JSON.stringify(options), "重试:" + tryCount +"次")
+          
            
         }
     } while (tryCount >= 1);