job
This commit is contained in:
@@ -21,6 +21,7 @@ const Action = require('../modules/action/action.model');
|
||||
const system = require('../modules/system/system.model');
|
||||
const { createAction } = require('../modules/action/action.handler');
|
||||
const { createNewFund } = require('../modules/fund/fund.handler');
|
||||
const exec = require('child_process').exec;
|
||||
|
||||
const tokenReleaseRate = 0.02;
|
||||
async function awardMine(user, fund) {
|
||||
@@ -148,10 +149,17 @@ async function confirm (job = mock, done = mock) {
|
||||
});
|
||||
return typeof done === 'function' && done('矿晶确认完成');
|
||||
}
|
||||
|
||||
async function mineJob (job = mock, done = mock) {
|
||||
exec('node ./src/jobs/mine.js');
|
||||
mylog.info('挖矿程序执行完毕');
|
||||
typeof done === 'function' && done('挖矿程序执行完毕');
|
||||
}
|
||||
|
||||
const jobs = [
|
||||
// {
|
||||
// name: 'mine',
|
||||
// processor: mine,
|
||||
// processor: mineJob,
|
||||
// type: 'every',
|
||||
// slot: '0 0 3 * * *',
|
||||
// priority: 'highest',
|
||||
@@ -161,6 +169,18 @@ const jobs = [
|
||||
// skipImmediate: true,
|
||||
// timezone: "ETC/GMT+8"
|
||||
// },
|
||||
{
|
||||
name: 'mine',
|
||||
processor: mineJob,
|
||||
type: 'every',
|
||||
slot: '0 0 2 * * *',
|
||||
priority: 'highest',
|
||||
unique: {
|
||||
id: 'mine'
|
||||
},
|
||||
skipImmediate: true,
|
||||
timezone: "ETC/GMT+8"
|
||||
},
|
||||
{
|
||||
name: 'confirm',
|
||||
processor: confirm,
|
||||
|
||||
Reference in New Issue
Block a user