From 85d015f34920c0b101149d532098b29875ef4880 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Sat, 9 Aug 2025 00:07:46 +0700 Subject: [PATCH] feat: check also waiting --- apps/cron/src/tasks/check.missing.queues.ts | 8 +++++--- apps/cron/src/tasks/post.now.pending.queues.ts | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/cron/src/tasks/check.missing.queues.ts b/apps/cron/src/tasks/check.missing.queues.ts index c383ab6a..6c9def7f 100644 --- a/apps/cron/src/tasks/check.missing.queues.ts +++ b/apps/cron/src/tasks/check.missing.queues.ts @@ -19,9 +19,11 @@ export class CheckMissingQueues { id: p.id, publishDate: p.publishDate, isJob: - (await this._workerServiceProducer - .getQueue('post') - .getJobState(p.id)) === 'delayed', + ['delayed', 'waiting'].indexOf( + await this._workerServiceProducer + .getQueue('post') + .getJobState(p.id) + ) > -1, })) ) ).filter((p) => !p.isJob); diff --git a/apps/cron/src/tasks/post.now.pending.queues.ts b/apps/cron/src/tasks/post.now.pending.queues.ts index 3138a25c..69105304 100644 --- a/apps/cron/src/tasks/post.now.pending.queues.ts +++ b/apps/cron/src/tasks/post.now.pending.queues.ts @@ -18,9 +18,11 @@ export class PostNowPendingQueues { id: p.id, publishDate: p.publishDate, isJob: - (await this._workerServiceProducer - .getQueue('post') - .getJobState(p.id)) === 'delayed', + ['delayed', 'waiting'].indexOf( + await this._workerServiceProducer + .getQueue('post') + .getJobState(p.id) + ) > -1, })) ) ).filter((p) => !p.isJob);