This commit is contained in:
哆啦好梦
2023-03-03 17:39:56 +08:00
parent 2473e17de1
commit 5516155940
10 changed files with 143 additions and 84 deletions

View File

@@ -677,6 +677,21 @@ class ExampleController extends Controller {
return data;
}
/**
* 任务
*/
someJob (args) {
let jobId = args.id;
if (args.type == 'timer') {
let myjob = new ChildJob();
myjob.exec('./jobs/example/timer', {jobId});
myjob.on('job-timer', (data) => {
Log.info('from TimerJob data:', data);
})
}
}
/**
* 测试接口
*/