aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/routes/(main)/+layout.server.ts
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-12-07 03:54:20 +0100
committerivarlovlie <git@ivarlovlie.no>2022-12-07 03:54:20 +0100
commit914c75e0ceeb3e11ddd55e94bb461c26b0db5b7a (patch)
treecec5c933b3beb64d4808cdc6bd8fcd8e4dc55421 /code/app/src/routes/(main)/+layout.server.ts
parent1a3c7bab2ad7deae0a778eb84b6d130df1bd9d36 (diff)
downloadgreatoffice-914c75e0ceeb3e11ddd55e94bb461c26b0db5b7a.tar.xz
greatoffice-914c75e0ceeb3e11ddd55e94bb461c26b0db5b7a.zip
feat:Small changes
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