check for the last 2 hours instead of 1 to limit false positives

This commit is contained in:
Florian Herrengt 2024-05-06 16:02:40 +01:00
parent b1a4251be9
commit 0b99b46256
1 changed files with 4 additions and 4 deletions

View File

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