|
@@ -61,7 +61,8 @@ async function getTransfers(ctx) {
|
|
//提交归集任务
|
|
//提交归集任务
|
|
if (temp_obj.address) {
|
|
if (temp_obj.address) {
|
|
logger.log('pushCollectConisObj>>>', temp_obj.address)
|
|
logger.log('pushCollectConisObj>>>', temp_obj.address)
|
|
- moralis.pushCollectConisObj(temp_obj)
|
|
|
|
|
|
+ // moralis.pushCollectConisObj(temp_obj)
|
|
|
|
+ redis.redis_push(reids_token_config.COLLECT_CONIS_QUEUE_KEY, JSON.stringify(temp_obj))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
@@ -82,6 +83,28 @@ async function getAllTokenWithdrawInfoLists(ctx) {
|
|
ctx.body = await moralis.getAllTokenWithdrawInfoLists(ctx);
|
|
ctx.body = await moralis.getAllTokenWithdrawInfoLists(ctx);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+async function collect_conis_task() {
|
|
|
|
+ while (true) {
|
|
|
|
+ var exec_obj = await redis.redis_pop(reids_token_config.COLLECT_CONIS_QUEUE_KEY)
|
|
|
|
+ if (!exec_obj) {
|
|
|
|
+ await utils.sleep(10000)
|
|
|
|
+ logger.log("没有归集任务")
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ exec_obj = JSON.parse(exec_obj)
|
|
|
|
+ } catch (error) {
|
|
|
|
+ logger.error('item parse error', error);
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ logger.log('collect_conis_task exec item>>>>', exec_obj);
|
|
|
|
+ //开始收集用户地址里面的币到归集地址
|
|
|
|
+ var ret = await moralis.collectCoins(exec_obj)
|
|
|
|
+ logger.log('collect_conis_task ret =', exec_obj, ret)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
async function withdraw_task() {
|
|
async function withdraw_task() {
|
|
// var status = await redis.readRedis(reids_token_config.WITHDRAW_QUEUE_STATUS)
|
|
// var status = await redis.readRedis(reids_token_config.WITHDRAW_QUEUE_STATUS)
|
|
// if (status && status == 1) {
|
|
// if (status && status == 1) {
|
|
@@ -93,7 +116,7 @@ async function withdraw_task() {
|
|
while (true) {
|
|
while (true) {
|
|
var exec_obj = await redis.redis_pop(reids_token_config.WITHDRAW_QUEUE_KEY)
|
|
var exec_obj = await redis.redis_pop(reids_token_config.WITHDRAW_QUEUE_KEY)
|
|
if (!exec_obj) {
|
|
if (!exec_obj) {
|
|
- await utils.sleep(5000)
|
|
|
|
|
|
+ await utils.sleep(10000)
|
|
logger.log("没有出金任务")
|
|
logger.log("没有出金任务")
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
@@ -321,6 +344,9 @@ router.post('/getWithdrawStatus', getWithdrawStatus);
|
|
//获取所有地址的所要消耗的最低提取费
|
|
//获取所有地址的所要消耗的最低提取费
|
|
router.post('/getAllTokenWithdrawInfoLists', getAllTokenWithdrawInfoLists)
|
|
router.post('/getAllTokenWithdrawInfoLists', getAllTokenWithdrawInfoLists)
|
|
|
|
|
|
-// 定时任务
|
|
|
|
|
|
+// 定时任务 提币+归集
|
|
withdraw_task();
|
|
withdraw_task();
|
|
|
|
+collect_conis_task();
|
|
|
|
+
|
|
|
|
+
|
|
module.exports = router
|
|
module.exports = router
|