agendash
This commit is contained in:
@@ -3,6 +3,7 @@ const { inject } = require('../common/Provider');
|
||||
const Agenda = require('agenda');
|
||||
const mongoose = require('mongoose');
|
||||
const mountJobs = require('./jobs');
|
||||
const exec = require('child_process').exec;
|
||||
|
||||
module.exports = () => inject(async function startJob(SysConfig) {
|
||||
const { DB_USER_NAME, DB_PASSWD, DB_HOST, DB_PORT, DB_NAME } = SysConfig;
|
||||
@@ -18,5 +19,8 @@ module.exports = () => inject(async function startJob(SysConfig) {
|
||||
mountJobs(Job);
|
||||
await Job.start();
|
||||
mylog.info('任务队列启动...');
|
||||
// app.use('/admin/myAgendash', Agendash(Job));
|
||||
exec(`npx agendash --db=mongodb://${DB_USER_NAME}:${DB_PASSWD.replace('&', `\\&`)}@${DB_HOST}:${DB_PORT}/${DB_NAME} --collection=agendaJobs --port=6057`);
|
||||
mylog.info('agendash启动...');
|
||||
return Job;
|
||||
});
|
||||
|
||||
@@ -170,7 +170,7 @@ const jobs = [
|
||||
// timezone: "ETC/GMT+8"
|
||||
// },
|
||||
{
|
||||
name: 'mine',
|
||||
name: 'mineCorn',
|
||||
processor: mineJob,
|
||||
type: 'every',
|
||||
slot: '0 0 2 * * *',
|
||||
|
||||
Reference in New Issue
Block a user