Bull 在第一个

问题描述

我有一个 Node/Express 应用程序,它允许用户使用请求正文中的字段进行 POST:name,url,and interval

  • 然后将上述字段传递给 queue.add
  • 负责的处理函数在指定的 url 处向指定的 interval 发出请求并记录响应。

问题是我打的第一个电话将创建一个作业并正常处理它。 但是,如果我用新数据再次调用它,Redis 中不会创建更多作业。

我只能看到 Redis 中的第一个作业条目,例如 bull:http:repeat:8c67330a4d444f9e84a1bb899165c85a:1616451420000

// The portion of the API controller responsible for creating the job.
...
const data = {
    url: req.body.url,//'https://google.com'
  };
const options = {
    delay: 1000,attempts: 2,repeat: { cron: `*/${req.body.interval} * * * *` },//'*/1 * * * *'
  };
await httpQueue.add(data,options);
...
Bull version
3.21.1

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)