mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-15 04:02:10 +08:00
job
This commit is contained in:
@@ -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);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试接口
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user