fix: job
This commit is contained in:
@@ -100,7 +100,7 @@ async function mine (job = mock, done = mock) {
|
|||||||
|
|
||||||
// 批量更新,每次十个
|
// 批量更新,每次十个
|
||||||
const userFundList = await Fund.find().sort('_id').limit(10).skip(currentIndex);
|
const userFundList = await Fund.find().sort('_id').limit(10).skip(currentIndex);
|
||||||
// job.touch();
|
typeof job.touch === 'function' && job.touch();
|
||||||
mylog.info('touch');
|
mylog.info('touch');
|
||||||
if (!userFundList || !Array.isArray(userFundList)) return 0;
|
if (!userFundList || !Array.isArray(userFundList)) return 0;
|
||||||
for (let i = 0, len = userFundList.length; i < len; ++i) {
|
for (let i = 0, len = userFundList.length; i < len; ++i) {
|
||||||
@@ -110,8 +110,10 @@ async function mine (job = mock, done = mock) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const user = await User.findById(fund.userId).exec();
|
const user = await User.findById(fund.userId).exec();
|
||||||
|
mylog.info('开始更新用户: ', user.id);
|
||||||
await doReward(user, fund);
|
await doReward(user, fund);
|
||||||
// job.touch();
|
mylog.info('用户: ', user.id, '更新完毕');
|
||||||
|
typeof job.touch === 'function' && job.touch();
|
||||||
await system.updateOne({ key: 'userIndex4job' }, {
|
await system.updateOne({ key: 'userIndex4job' }, {
|
||||||
$set: {
|
$set: {
|
||||||
value: currentIndex
|
value: currentIndex
|
||||||
@@ -119,7 +121,7 @@ async function mine (job = mock, done = mock) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
mylog.info('收益计算分配完成');
|
mylog.info('收益计算分配完成');
|
||||||
// done('收益计算分配完成');
|
typeof done === 'function' && done('收益计算分配完成');
|
||||||
}
|
}
|
||||||
async function confirm (job = mock, done = mock) {
|
async function confirm (job = mock, done = mock) {
|
||||||
mylog.info('[Schedule Job] 矿晶确认程序开始执行......');
|
mylog.info('[Schedule Job] 矿晶确认程序开始执行......');
|
||||||
|
|||||||
Reference in New Issue
Block a user