job touch
This commit is contained in:
@@ -56,7 +56,14 @@ async function awardMine(user, fund) {
|
||||
});
|
||||
return 0;
|
||||
}
|
||||
sum += +fund.fundList[i].amount * tokenReleaseRate;
|
||||
const profit = +fund.fundList[i].amount * tokenReleaseRate;
|
||||
await Fund.findByIdAndUpdate(fund.id, {
|
||||
$inc: {
|
||||
[`fundList.${i}.mineCount`]: 1,
|
||||
[`fundList.${i}.releasedAmout`]: profit,
|
||||
},
|
||||
});
|
||||
sum += profit;
|
||||
}
|
||||
return sum.toFixed(2);
|
||||
}
|
||||
@@ -156,14 +163,17 @@ async function mine (job = mock, done = mock) {
|
||||
value: -1
|
||||
}
|
||||
});
|
||||
typeof process.send === 'function' && process.send('tick');
|
||||
}
|
||||
currentIndex += 10;
|
||||
probe.currentIndex = currentIndex;
|
||||
}
|
||||
mylog.info('收益计算分配完成');
|
||||
typeof process.send === 'function' && process.send('tick');
|
||||
await system.findOneAndUpdate({
|
||||
key: 'userIndex4job'
|
||||
}, { $set: { value: 0 } }).exec();
|
||||
typeof process.send === 'function' && process.send('tick');
|
||||
await system.findOneAndUpdate({
|
||||
key: 'mineCount',
|
||||
}, {
|
||||
@@ -171,12 +181,13 @@ async function mine (job = mock, done = mock) {
|
||||
value: 1
|
||||
}
|
||||
}, { upsert: true });
|
||||
typeof process.send === 'function' && process.send('tick');
|
||||
await system.findOneAndUpdate({
|
||||
key: 'lastMine',
|
||||
}, {
|
||||
value: new Date().toISOString()
|
||||
}, { upsert: true });
|
||||
|
||||
typeof process.send === 'function' && process.send('tick');
|
||||
typeof done === 'function' && done('收益计算分配完成');
|
||||
process.exit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user