简体   繁体   English

Bull Queue如何进行无限尝试?

[英]How to do infinite attempts in Bull Queue?

I am trying to send a user email after he registeres on my website在我的网站上注册后,我试图发送用户 email

My current code looks like this我当前的代码看起来像这样

const data = {
      from: 'no-reply@test.com',
      to: req.user.email,
      subject: 'Please reset your Test Account Password',
      text:
        'This is a test email to ask you to reset your Test Account Password. Good luck :)',
    }
    const options = {
      attempts: 1000,
      backoff: { type: 'exponential', delay: 30000 },
      removeOnComplete: true,
    }
    sendMailQueue.add('resetEmail', data, options)

How do I set the attempts to INFINITE?如何将尝试设置为无限?

In producer, set attempts while creating new task在生产者中,在创建新任务时设置尝试

const taskOpts = {
    attempts: Number.MAX_SAFE_INTEGER,
}

Client.add(taskType, taskData, taskOpts)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM