我有一堆工作在公牛队列中,其中一个被卡住了 1 个多小时(通常需要大约 2 分钟才能运行),但没有失败。我无法使用我使用的 bull arena UI 将作业从活动状态中删除,因此我删除了 Redis 中活动作业的密钥。
这消除了卡住的活动作业,但现在队列没有从等待列表中拉出任何作业。
有任何想法吗?关于如何修复它有什么想法吗?
我正在尝试使用 Bull/Redis 实现 Nodemailer 来处理 NestJS 中的电子邮件类型的任务。
\n我有一个名为的共享模块EmailService,它将一个作业添加到我的队列中,为此,它需要注入Queuefrom \'bull\'。
\n\nNest 无法解析 EmailService 的依赖关系(?)。请确保索引 [0] 处的参数 BullQueue_mailqueue 在 SharedModule 上下文中可用。
\n
我的结构
\n\xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 src\n| \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 app.module.ts\n| \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 config\n| | \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 nodemailer\n| | \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 nodemailer.module.ts\n| | \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 nodemailer.service.ts\n| \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 modules\n| \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 modules that imports the SharedModule to send emails.\n| \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 shared\n| \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 processors\n| | \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 email.processor.ts\n| \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 services\n| | \xe2\x94\x94\xe2\x94\x80\xe2\x94\x80 email\n| \xe2\x94\x9c\xe2\x94\x80\xe2\x94\x80 shared.module.ts\nRun Code Online (Sandbox Code Playgroud)\n应用程序模块
\n@Module({\n imports: [\n NodemailerModule,\n // Al …Run Code Online (Sandbox Code Playgroud) 寻找一种方法让bull重试失败的作业并具有更高的优先级。更具体地说,我希望在任何非失败的作业之前先选择失败的作业。
设置“重试次数”之类的东西相当容易,但据我所知,关于重试策略就没有其他设置了。