Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Midway-task
简介
Midway-task是为了能解决任务系列的模块,例如分布式定时任务、延迟任务调度。例如订单2小时后失效、每日定时的数据处理等工作。
安装方法
使用方法
在Configuration.ts导入子组件
配置:
在 config.default.ts 文件中配置对应的模块信息:
业务代码编写方式
分布式定时任务:
本地定时任务:
定时执行任务:
让用户定义任务
@controller()
/hello
console.log(this.xxx)
->调用扩容接口
this.queueService.add(HelloTask.xxx, params, {deplay: 1min}); //立马执行
其他
关于task任务的配置: