feat: no sleep option

This commit is contained in:
Nevo David 2026-01-05 18:00:49 +07:00
parent 1291937cb2
commit 0144e39841
1 changed files with 5 additions and 1 deletions

View File

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