Skip to content

Commit

Permalink
Merge pull request #1967 from DefiLlama/fix-restricted-hour
Browse files Browse the repository at this point in the history
fix restricted
  • Loading branch information
dtmkeng authored Oct 6, 2024
2 parents 02a3510 + 0fb234a commit ab3f0b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions helpers/dune.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
throw new Error(`Current hour is ${currentHour}. In restricted mode, can run dune queries only between 1am - 3am UTC`);
}

0 comments on commit ab3f0b5

Please sign in to comment.