18 lines
329 B
JavaScript
18 lines
329 B
JavaScript
const Subscription = require('egg').Subscription;
|
|
|
|
class checkOnline extends Subscription {
|
|
static get schedule() {
|
|
return {
|
|
interval: '300s',
|
|
type: 'worker',
|
|
};
|
|
}
|
|
async subscribe() {
|
|
const {
|
|
ctx
|
|
} = this;
|
|
await this.ctx.service.tgdp.checkOnline();
|
|
}
|
|
}
|
|
module.exports = checkOnline;
|