15815213711
2024-08-26 f988680f27ff7393867ed3828010ca2d4c6f9a9e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;