chore: Make scheduled job tests less likely to fail (#8241)

This commit is contained in:
Stevche Radevski
2024-07-23 16:59:27 +02:00
committed by GitHub
parent a9abf448c6
commit bcba5b3a6c
3 changed files with 62 additions and 16 deletions

View File

@@ -395,7 +395,14 @@ export class RedisDistributedTransactionStorage
}
async remove(jobId: string): Promise<void> {
await this.queue.removeRepeatableByKey(`${JobType.SCHEDULE}_${jobId}`)
const repeatableJobs = await this.queue.getRepeatableJobs()
const job = repeatableJobs.find(
(job) => job.id === `${JobType.SCHEDULE}_${jobId}`
)
if (job) {
await this.queue.removeRepeatableByKey(job.key)
}
}
async removeAll(): Promise<void> {