From 0b99b4625646e7cbed583118b45eb6bfeabee76e Mon Sep 17 00:00:00 2001 From: Florian Herrengt Date: Mon, 6 May 2024 16:02:40 +0100 Subject: [PATCH] check for the last 2 hours instead of 1 to limit false positives --- src/events.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/events.test.ts b/src/events.test.ts index abf2382..0287025 100644 --- a/src/events.test.ts +++ b/src/events.test.ts @@ -4,8 +4,8 @@ import { sum } from "lodash"; import * as dateFns from "date-fns"; import { clickhouseClient, knex } from "./databases"; -const oneHourAgo = dateFns.format( - dateFns.subHours(new Date(), 1), +const twoHourAgo = dateFns.format( + dateFns.subHours(new Date(), 2), "yyyy-MM-dd hh:mm:ss" ); @@ -15,7 +15,7 @@ describe("Events", () => { await clickhouseClient.query({ query: knex("events") .count("") - .where("created_at", ">", oneHourAgo) + .where("created_at", ">", twoHourAgo) .toString(), }) ).json()) as any; @@ -26,7 +26,7 @@ describe("Events", () => { await clickhouseClient.query({ query: knex("events") .count() - .where("created_at", ">", oneHourAgo) + .where("created_at", ">", twoHourAgo) .groupBy("geo_ip_country") .toString(), format: "JSON",