init项目

This commit is contained in:
2024-08-07 21:48:41 +08:00
parent 2c3a02d33b
commit 1581a5aaf5
18 changed files with 938 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
const Job = require('ee-core/jobs/baseJobClass');
const Log = require('ee-core/log');
const Ps = require('ee-core/ps');
/**
* example - TimerJob
* @class
*/
class TimerJob extends Job {
constructor(params) {
super();
this.params = params;
}
/**
* handle()方法是必要的,且会被自动调用
*/
async handle () {
Log.info("[child-process] TimerJob params: ", this.params);
if (Ps.isChildJob()) {
Ps.exit();
}
}
}
TimerJob.toString = () => '[class TimerJob]';
module.exports = TimerJob;