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;