From 9e8f2598f532a908ec2adeeedcb05fee3aa4ea72 Mon Sep 17 00:00:00 2001 From: Collin Duncan <3679940+cgduncan7@users.noreply.github.com> Date: Wed, 10 Apr 2024 08:57:17 +0200 Subject: [PATCH] Fixing expression to check for 7AM --- src/reservations/cron.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reservations/cron.ts b/src/reservations/cron.ts index 94cc5d6..8e64dce 100644 --- a/src/reservations/cron.ts +++ b/src/reservations/cron.ts @@ -57,7 +57,7 @@ export class ReservationsCronService { .set('millisecond', 0) while (not7AM) { - not7AM = time7AM.isBefore(dayjs()) && time7AM.diff(dayjs()) >= waitTime // current time is more than 100ms from 7am + not7AM = !time7AM.isBefore(dayjs()) && time7AM.diff(dayjs()) >= waitTime // current time is more than 100ms from 7am if (!not7AM) break await new Promise((res) => setTimeout(res, waitTime)) // wait for waitTime and then try again }