fix: job
This commit is contained in:
@@ -18,4 +18,5 @@ module.exports = () => inject(async function startJob(SysConfig) {
|
||||
mountJobs(Job);
|
||||
await Job.start();
|
||||
mylog.info('任务队列启动...');
|
||||
return Job;
|
||||
});
|
||||
|
||||
@@ -76,11 +76,6 @@ const jobs = [
|
||||
name: 'mine',
|
||||
processor: async (job, done) => {
|
||||
//todo: 程序内检查是否可以执行,保证不会启动时错误的自动执行一次
|
||||
const now = new Date();
|
||||
if (now.getHours() !== 23 && now.getMinutes() < 58) {
|
||||
mylog.error('[Schedule Job] 不在合理时间启动...程序结束');
|
||||
return done();
|
||||
}
|
||||
mylog.info('[Schedule Job] 开始定时计算作业...');
|
||||
let currentIndex = await system.findOne({
|
||||
key: 'userIndex4job'
|
||||
@@ -106,7 +101,7 @@ const jobs = [
|
||||
job.touch();
|
||||
}
|
||||
mylog.info('收益计算分配完成');
|
||||
done();
|
||||
done('收益计算分配完成');
|
||||
},
|
||||
type: 'every',
|
||||
slot: '0 0 3 * * *',
|
||||
|
||||
Reference in New Issue
Block a user