From 0fb234a00d02f5ba3019d2a0a6637a694d832ab2 Mon Sep 17 00:00:00 2001 From: 0xgnek <0xgnek@gmail.com> Date: Sun, 6 Oct 2024 11:08:17 +0000 Subject: [PATCH] fix restricted --- helpers/dune.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/dune.ts b/helpers/dune.ts index bbd4480370..d28559c40b 100644 --- a/helpers/dune.ts +++ b/helpers/dune.ts @@ -122,7 +122,7 @@ export const queryDuneSql = (options: any, query: string) => { export function checkCanRunDuneQuery() { if (!isRestrictedMode) return; - const currentHour = new Date().getHours(); + const currentHour = new Date().getUTCHours(); if (currentHour >= 1 && currentHour <= 3) return; // 1am - 3am - any time other than this, throw error - throw new Error("In restricted mode, can run dune queries only between 1am - 3am UTC"); -} \ No newline at end of file + throw new Error(`Current hour is ${currentHour}. In restricted mode, can run dune queries only between 1am - 3am UTC`); +}