Session details screen.

This commit is contained in:
Mike Cao 2024-07-29 19:09:13 -07:00
parent c3c3b46ef6
commit f32bf0a2e0
21 changed files with 252 additions and 33 deletions

View file

@ -1,4 +1,4 @@
import { getSession, getWebsite } from 'queries';
import { getWebsiteSession, getWebsite } from 'queries';
import { Website, Session } from '@prisma/client';
import redis from '@umami/redis-client';
@ -22,9 +22,13 @@ export async function fetchSession(sessionId: string): Promise<Session> {
let session = null;
if (redis.enabled) {
session = await redis.client.fetch(`session:${sessionId}`, () => getSession(sessionId), 86400);
session = await redis.client.fetch(
`session:${sessionId}`,
() => getWebsiteSession(sessionId),
86400,
);
} else {
session = await getSession(sessionId);
session = await getWebsiteSession(sessionId);
}
if (!session) {