From 0144e3984167da885f7bf177eee5baaadc64e7b8 Mon Sep 17 00:00:00 2001 From: Nevo David Date: Mon, 5 Jan 2026 18:00:49 +0700 Subject: [PATCH] feat: no sleep option --- apps/orchestrator/src/workflows/post.workflow.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/orchestrator/src/workflows/post.workflow.ts b/apps/orchestrator/src/workflows/post.workflow.ts index 0901a5e8..37ca1864 100644 --- a/apps/orchestrator/src/workflows/post.workflow.ts +++ b/apps/orchestrator/src/workflows/post.workflow.ts @@ -85,7 +85,11 @@ export async function postWorkflow({ // if it's a repeatable post, we should ignore this. if (!postNow) { - await sleep(dayjs(post.publishDate).diff(dayjs(), 'millisecond')); + await sleep( + dayjs(post.publishDate).isBefore(dayjs()) + ? 0 + : dayjs(post.publishDate).diff(dayjs(), 'millisecond') + ); } // if refresh is needed from last time, let's inform the user