mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Updated queries to use cache.
This commit is contained in:
parent
74192cd695
commit
728e4cff5b
9 changed files with 59 additions and 42 deletions
|
|
@ -1,9 +1,8 @@
|
|||
import cache from 'lib/cache';
|
||||
import clickhouse from 'lib/clickhouse';
|
||||
import { CLICKHOUSE, PRISMA, runQuery } from 'lib/db';
|
||||
import prisma from 'lib/prisma';
|
||||
import { WebsiteEventDataMetric } from 'lib/types';
|
||||
import { getWebsite } from 'queries';
|
||||
import { loadWebsite } from 'lib/query';
|
||||
|
||||
export async function getEventData(
|
||||
...args: [
|
||||
|
|
@ -49,7 +48,7 @@ async function relationalQuery(
|
|||
) {
|
||||
const { startDate, endDate, timeSeries, eventName, urlPath, filters } = data;
|
||||
const { toUuid, rawQuery, getEventDataFilterQuery, getDateQuery } = prisma;
|
||||
const website = await getWebsite({ id: websiteId });
|
||||
const website = await loadWebsite(websiteId);
|
||||
const resetDate = website?.resetAt || website?.createdAt;
|
||||
const params: any = [websiteId, resetDate, startDate, endDate, eventName || ''];
|
||||
|
||||
|
|
@ -99,7 +98,7 @@ async function clickhouseQuery(
|
|||
const { startDate, endDate, timeSeries, eventName, urlPath, filters } = data;
|
||||
const { rawQuery, getDateFormat, getBetweenDates, getDateQuery, getEventDataFilterQuery } =
|
||||
clickhouse;
|
||||
const website = await cache.fetchWebsite(websiteId);
|
||||
const website = await loadWebsite(websiteId);
|
||||
const resetDate = website?.resetAt || website?.createdAt;
|
||||
const params = { websiteId };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue