fix clickhouse date timezone issues

This commit is contained in:
Francis Cao 2022-08-08 22:09:18 -07:00
parent fc3c39be3c
commit 55ba7d95ab
7 changed files with 7647 additions and 4840 deletions

View file

@ -1,6 +1,7 @@
import { CLICKHOUSE, RELATIONAL, KAFKA, URL_LENGTH } from 'lib/constants';
import {
getDateFormatClickhouse,
getDateFormatKafka,
prisma,
rawQueryClickhouse,
runAnalyticsQuery,
@ -50,7 +51,7 @@ async function clickhouseQuery(website_id, { event_uuid, session_uuid, url, even
return rawQueryClickhouse(
`
insert into umami_dev.event (created_at, website_id, session_uuid, url, event_name)
insert into umami.event (created_at, website_id, session_uuid, url, event_name)
values (${getDateFormatClickhouse(new Date())}, $1, $2, $3, $4);`,
params,
);
@ -61,6 +62,7 @@ async function kafkaQuery(website_id, { event_uuid, session_uuid, url, event_nam
event_uuid: event_uuid,
website_id: website_id,
session_uuid: session_uuid,
created_at: getDateFormatKafka(new Date()),
url: url?.substr(0, URL_LENGTH),
event_name: event_name?.substr(0, 50),
};