mpc-cli
Version:
码农村nodejs版本myprocesscontroller框架脚手架搭建器
24 lines (23 loc) • 775 B
JavaScript
//console.log = function() {};
import V from 'gcl';
import pro from 'myprocesscontroller';
//启动一个进程,内部进行默认属性设置
//this.Config,this.Middler,this.Ni,this.Log
pro.start(async function() {
const conf = V.AppSettings(this.Config, "DY");
if (!conf) throw new Error('配置获取失败!');
const that = this;
const job = new class extends pro.ACronJob {
constructor() {
//cron expression
super('cleanData', conf.corn);
}
async go(data) {
//todo JOB
//attach const res = await that.Ni.excute('command',params);
return false;
}
};
//todo jobs
return new pro.CACProcess(new pro.CronWorker('cleanData', [job]), this.Log, 1, 100)
});