aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/routes/(main)/+layout.server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'code/app/src/routes/(main)/+layout.server.ts')
-rw-r--r--code/app/src/routes/(main)/+layout.server.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/code/app/src/routes/(main)/+layout.server.ts b/code/app/src/routes/(main)/+layout.server.ts
index a4507e1..cd41734 100644
--- a/code/app/src/routes/(main)/+layout.server.ts
+++ b/code/app/src/routes/(main)/+layout.server.ts
@@ -7,7 +7,7 @@ import type { LayoutServerLoad } from "./$types";
export const load: LayoutServerLoad = async ({ route, cookies, locals }) => {
const isBaseRoute = route.id === "/(main)";
const isPublicRoute = (route.id?.startsWith("/(main)/(public)") || isBaseRoute) ?? true;
- const sessionIsValid = (await cached_result<Response>("sessionCheck", 10, () => fetch(api_base("_/valid-session"), {
+ const sessionIsValid = (await cached_result<Response>("sessionCheck", 120, () => fetch(api_base("_/valid-session"), {
headers: {
Cookie: CookieNames.session + "=" + cookies.get(CookieNames.session)
}
@@ -50,7 +50,8 @@ async function cached_result<T>(key: string, staleAfterSeconds: number, code: an
resultCache[key].l = Temporal.Now.instant().epochSeconds;
}
- console.log({
+ log_debug("Ran cached_result", {
+ cacheKey: key,
isStale,
cache: resultCache[key],
staleEpoch