我需要从队列中删除特定的单个作业。实际情况是,我向队列中添加了一个作业,然后在一些API调用中,我需要从队列中删除单个作业。因此,它不会在未来重复。
添加:
const job = await this.locationQueue.add('alert', { handle, author, data }, { repeat: { every: 60000 } });删除:
await this.locationQueue.removeRepeatable('alert', { jobId: request.jobKey, every: 60000 });其中request.jobKey是add中的job.id。
发布于 2021-05-06 18:44:23
据我所知,在将其添加到队列时,您需要指定相同的jobId。
const job = await this.locationQueue.add('alert', { handle, author, data, jobId: 'some job unique job id'}, { repeat: { every: 60000 } });https://stackoverflow.com/questions/67415053
复制相似问题