|
@@ -172,10 +172,12 @@ async function getAccountBalances(options) {
|
|
logger.log('getAccountBalances :', options)
|
|
logger.log('getAccountBalances :', options)
|
|
|
|
|
|
|
|
|
|
- //做 1次 重试
|
|
|
|
|
|
+ //做 3次 重试,每次间隔 1s+=
|
|
//Error: Request failed with status code 524
|
|
//Error: Request failed with status code 524
|
|
//Error: Request failed with status code 500
|
|
//Error: Request failed with status code 500
|
|
- var tryCount = 2;
|
|
|
|
|
|
+ var tryCount = 4;
|
|
|
|
+ var delay = 1000
|
|
|
|
+ var interval = 500
|
|
var result;
|
|
var result;
|
|
do {
|
|
do {
|
|
try {
|
|
try {
|
|
@@ -193,7 +195,8 @@ async function getAccountBalances(options) {
|
|
result = null;
|
|
result = null;
|
|
}
|
|
}
|
|
tryCount -= 1;
|
|
tryCount -= 1;
|
|
- await utils.sleep(1000)
|
|
|
|
|
|
+ await utils.sleep(delay)
|
|
|
|
+ delay += interval
|
|
}
|
|
}
|
|
} while (tryCount >= 1);
|
|
} while (tryCount >= 1);
|
|
return result
|
|
return result
|
|
@@ -913,7 +916,9 @@ async function getTokenTransfers(opt) {
|
|
|
|
|
|
// Error: Request failed with status code 524
|
|
// Error: Request failed with status code 524
|
|
// 做一次重试
|
|
// 做一次重试
|
|
- var tryCount = 2
|
|
|
|
|
|
+ var tryCount = 4;
|
|
|
|
+ var delay = 1000
|
|
|
|
+ var interval = 500
|
|
do {
|
|
do {
|
|
//主流币
|
|
//主流币
|
|
try {
|
|
try {
|
|
@@ -928,13 +933,16 @@ async function getTokenTransfers(opt) {
|
|
return toJson(ERROR_CODE_001, null, error.toString());
|
|
return toJson(ERROR_CODE_001, null, error.toString());
|
|
}
|
|
}
|
|
tryCount -= 1;
|
|
tryCount -= 1;
|
|
- await utils.sleep(1000)
|
|
|
|
|
|
+ await utils.sleep(delay)
|
|
|
|
+ delay += interval
|
|
}
|
|
}
|
|
} while (tryCount >= 1);
|
|
} while (tryCount >= 1);
|
|
|
|
|
|
|
|
|
|
// Error: Request failed with status code 524
|
|
// Error: Request failed with status code 524
|
|
- tryCount = 2
|
|
|
|
|
|
+ tryCount = 4
|
|
|
|
+ delay = 1000
|
|
|
|
+ interval = 500
|
|
do {
|
|
do {
|
|
//20币
|
|
//20币
|
|
try {
|
|
try {
|
|
@@ -953,7 +961,8 @@ async function getTokenTransfers(opt) {
|
|
return toJson(ERROR_CODE_001, null, error.toString());
|
|
return toJson(ERROR_CODE_001, null, error.toString());
|
|
}
|
|
}
|
|
tryCount -= 1;
|
|
tryCount -= 1;
|
|
- await utils.sleep(1000)
|
|
|
|
|
|
+ await utils.sleep(delay)
|
|
|
|
+ delay += interval
|
|
}
|
|
}
|
|
} while (tryCount >= 1);
|
|
} while (tryCount >= 1);
|
|
|
|
|