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

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

No files matched your search

@@ -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> {