-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
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
WIP: feat: refactor hookTrigger by BullMQ #544
Conversation
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat's wrong with native code?Contains native code which could be a vector to obscure malicious code, and generally decrease the likelihood of reproducible or reliable installs. Ensure that native code bindings are expected. Consumers may consider pure JS and functionally similar alternatives to avoid the challenges and risks associated with native code bindings. Take a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Codecov Report
@@ Coverage Diff @@
## master #544 +/- ##
==========================================
+ Coverage 97.02% 97.18% +0.16%
==========================================
Files 174 176 +2
Lines 16588 16720 +132
Branches 2177 2203 +26
==========================================
+ Hits 16095 16250 +155
+ Misses 493 470 -23
|
@@ -60,10 +65,15 @@ export class TaskService extends AbstractService { | |||
return existsTask; | |||
} | |||
await this.taskRepository.saveTask(task); | |||
await this.queueAdapter.push<string>(task.type, task.taskId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我理解发消息是在 queueAdapter 里面包掉的?TaskService 不应该感知这个逻辑。
@@ -60,10 +65,15 @@ export class TaskService extends AbstractService { | |||
return existsTask; | |||
} | |||
await this.taskRepository.saveTask(task); | |||
await this.queueAdapter.push<string>(task.type, task.taskId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我理解发消息是在 queueAdapter 里面包掉的?TaskService 不应该感知这个逻辑。
@elrrrrrrr 直接使用 rocketmq 实现吧,npmmirror 在阿里云部署,支持的。 |
pr 先 close 了,让我们相约 rockect mq |
AbstractWorker
andHookTriggerWorker
, which replace the previous polling method used for scheduling tasks.*❓ Due to the asynchronous nature of worker task scheduling in BullMQ, a separate context (ctx) needs to be created to manage the execution environment.
*❓ BullMQ does not natively support timeout configuration and does not provide built-in worker concurrency status.
AbstractWorker
及HookTriggerWorker
,用以替换定时任务轮询方式