check for the last 2 hours instead of 1 to limit false positives
This commit is contained in:
parent
b1a4251be9
commit
0b99b46256
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue