diff --git a/clean.js b/clean.js index 5253572..534ab48 100644 --- a/clean.js +++ b/clean.js @@ -49,10 +49,10 @@ async function clean () { const rest = boughtAmountSum - releasedAmout; mylog.info('No. ', currentIndex, '用户' + userFund.userId, '剩余 ', rest); const vic = userFund.asset.vic || 0; - await Fund.findByIdAndUpdate(userFund.id, { vicFundSum: vic, 'asset.vic': 0, fundList: [], 'option.restNeetToRelease': rest, snapshot: { asset: userFund.asset } }); + const newFund = vic + rest; + await Fund.findByIdAndUpdate(userFund.id, { vicFundSum: newFund, 'asset.vic': 0, 'asset.usdt': 0, fundList: [], snapshot: { asset: userFund.asset, fundList } }); probe.currentIndex = currentIndex; } - process.exit(); } const start = async (job, done) => { @@ -83,6 +83,7 @@ const start = async (job, done) => { typeof process.send === 'function' && process.send('子进程开始执行mine'); clean(job, done); typeof process.send === 'function' && process.send('子进程mine执行完毕'); + process.exit(); }; start();