|
@@ -755,9 +755,38 @@ async function timer_transfer_czz_task() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+async function checkout_taxhash(exec_obj) {
|
|
|
+ logger.info('bsc_log_monitoring exec start:', exec_obj)
|
|
|
+ var delay = 60 * 1000
|
|
|
+ try {
|
|
|
+ if (typeof exec_obj === 'string')
|
|
|
+ exec_obj = JSON.parse(exec_obj)
|
|
|
+ } catch (error) {
|
|
|
+ logger.error('bsc_log_monitoring:', error)
|
|
|
+ }
|
|
|
+
|
|
|
+ var tryCount = 5
|
|
|
+ do {
|
|
|
+ if (tryCount == 0) {
|
|
|
+ logger.error('数据在5分钟未更新', JSON.stringify(exec_obj))
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if (exec_obj.transactionHash) {
|
|
|
+ var ret = await account_mysql.getAccountTransactions({
|
|
|
+ type: 'only_hash',
|
|
|
+ transaction_hash: exec_obj.transactionHash
|
|
|
+ })
|
|
|
+ if (ret && ret.code == 0 && ret.data.total > 0) {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ --tryCount
|
|
|
+ logger.debug('getAccountTransactions', tryCount, exec_obj)
|
|
|
+ await utils.sleep(delay)
|
|
|
+ } while (tryCount >= 0);
|
|
|
+}
|
|
|
|
|
|
async function bsc_log_monitoring() {
|
|
|
- var delay = 60 * 1000
|
|
|
while (1) {
|
|
|
var exec_obj = await redis.redis_pop(reids_token_config.BSC_LOG_MONITORING_KEY)
|
|
|
if (!exec_obj) {
|
|
@@ -765,35 +794,7 @@ async function bsc_log_monitoring() {
|
|
|
logger.log("no new check tasks")
|
|
|
continue
|
|
|
}
|
|
|
-
|
|
|
- logger.info('bsc_log_monitoring exec start:', exec_obj)
|
|
|
-
|
|
|
- try {
|
|
|
- if (typeof exec_obj === 'string')
|
|
|
- exec_obj = JSON.parse(exec_obj)
|
|
|
- } catch (error) {
|
|
|
- logger.error('bsc_log_monitoring:', error)
|
|
|
- }
|
|
|
-
|
|
|
- var tryCount = 5
|
|
|
- do {
|
|
|
- if (tryCount == 0) {
|
|
|
- logger.error('数据在5分钟未更新', JSON.stringify(exec_obj))
|
|
|
- break
|
|
|
- }
|
|
|
- if (exec_obj.transactionHash) {
|
|
|
- var ret = await account_mysql.getAccountTransactions({
|
|
|
- type: 'only_hash',
|
|
|
- transaction_hash: exec_obj.transactionHash
|
|
|
- })
|
|
|
- if (ret && ret.code == 0 && ret.data.total > 0) {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- --tryCount
|
|
|
- logger.debug('getAccountTransactions', tryCount, exec_obj)
|
|
|
- await utils.sleep(delay)
|
|
|
- } while (tryCount >= 0);
|
|
|
+ checkout_taxhash(exec_obj)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -829,10 +830,10 @@ check_czz_withdraw_task();
|
|
|
bsc_log_monitoring()
|
|
|
|
|
|
if (process.env.NODE_ENV == 'dev' || process.env.NODE_ENV == 'test') {
|
|
|
- // timer_transfer_bsc_task()
|
|
|
- // timer_transfer_czz_task()
|
|
|
- // timer_collect_conis_bsc_task()
|
|
|
- // timer_collect_conis_czz_task()
|
|
|
+ timer_transfer_bsc_task()
|
|
|
+ timer_transfer_czz_task()
|
|
|
+ timer_collect_conis_bsc_task()
|
|
|
+ timer_collect_conis_czz_task()
|
|
|
}
|
|
|
|
|
|
module.exports = router
|