We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'use strict'; import { IntervalParams, Schedule, ScheduleType } from '@eggjs/tegg/schedule';
@schedule({ type: ScheduleType.WORKER, scheduleData: { interval: 600 * 10, } }) // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error export class onlineSchedule { async subscribe(ctx) { console.log(ctx, 'SSEService') } }
是否可以支持subscribe里默认获取ctx类似于eggjs中task参数可以拿到ctx
'use strict'; const { nowTime } = require("../utils"); module.exports = app => { return { schedule: { interval: '120s', // 2分钟间隔 // cron: '0 0 0 * * ?', type: 'all', // 指定所有的 worker 都需要执行 }, async task(ctx) { await ctx.service.global.judgeUserExpire() console.log('2分钟执行一次,检查退出咨询情况' + nowTime()) }, }; };
暂无
18.0.0
3.12.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在此输入你需要反馈的 Bug 具体信息(Bug in Detail):
'use strict';
import { IntervalParams, Schedule, ScheduleType } from '@eggjs/tegg/schedule';
@schedule({
type: ScheduleType.WORKER,
scheduleData: {
interval: 600 * 10,
}
})
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
export class onlineSchedule {
async subscribe(ctx) {
console.log(ctx, 'SSEService')
}
}
是否可以支持subscribe里默认获取ctx类似于eggjs中task参数可以拿到ctx
'use strict';
const { nowTime } = require("../utils");
module.exports = app => {
return {
schedule: {
interval: '120s', // 2分钟间隔
// cron: '0 0 0 * * ?',
type: 'all', // 指定所有的 worker 都需要执行
},
async task(ctx) {
await ctx.service.global.judgeUserExpire()
console.log('2分钟执行一次,检查退出咨询情况' + nowTime())
},
};
};
可复现问题的仓库地址(Reproduction Repo)
暂无
Node 版本号:
18.0.0
TEgg 版本号:
3.12.0
相关插件名称与版本号:
3.12.0
操作平台与版本号:
3.12.0
The text was updated successfully, but these errors were encountered: