Node.js Kue how to restart failed jobs

后端 未结 3 986
孤独总比滥情好
孤独总比滥情好 2020-12-30 04:42

I am using kue for delayed jobs in my node.js application.

I have some problems to figure out how I can restart a job using the API of kue without having to move th

3条回答
  •  没有蜡笔的小新
    2020-12-30 05:14

    i dont know if this is working but you could try to reset the state of the job to active, and save the job again:

    job.on('failed', function() {
      job.state('inactive').save();
    

    Edit: setting state to inactive will correctly re-enqueue the task.

提交回复
热议问题