0

例如,我想在可重复作业回调中的某个位置执行一些操作

const Bull = require('bull');
const queue = new Bull('payment');

// should repeat this task every 5 minutes , 24 times
queue.add('trackPayment' , anyData , {
    repeat : {
        every : 300000,
        limit : 24,
    }
});

queue.process('trackPayment' , async (data) => {
 // this job have a limit of 24 iterations
 // would like to do some action in the iteration #24
 /*
    if (data.iteration == 24) doAction();
 */
})
4

0 回答 0