diff options
| author | iv-ar <i@oiee.no> | 2023-03-04 16:54:16 +0100 |
|---|---|---|
| committer | iv-ar <i@oiee.no> | 2023-03-04 16:54:16 +0100 |
| commit | cf546fd4b9a1fbf77bccf5f0b713e688d29a66ad (patch) | |
| tree | 8103d953afec0618a55dc957ba8a3222dac0e842 /code/app/src/utilities/cache.ts | |
| parent | b85164718d3bd6a4ad5fc06d04a3ce2dc028b1db (diff) | |
| download | greatoffice-cf546fd4b9a1fbf77bccf5f0b713e688d29a66ad.tar.xz greatoffice-cf546fd4b9a1fbf77bccf5f0b713e688d29a66ad.zip | |
feat: Use console to log
Diffstat (limited to 'code/app/src/utilities/cache.ts')
| -rw-r--r-- | code/app/src/utilities/cache.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/code/app/src/utilities/cache.ts b/code/app/src/utilities/cache.ts index db9be9a..101f192 100644 --- a/code/app/src/utilities/cache.ts +++ b/code/app/src/utilities/cache.ts @@ -1,11 +1,10 @@ -import { Temporal } from "temporal-polyfill"; -import { log_debug } from "$utilities/logger"; +import {Temporal} from "temporal-polyfill"; let cache = {}; export const CacheKeys = { - isAuthenticated: "isAuthenticated" -} + isAuthenticated: "isAuthenticated", +}; export async function cached_result_async<T>(key: string, staleAfterSeconds: number, get_result: any, forceRefresh: boolean = false) { if (!cache[key]) { @@ -21,7 +20,7 @@ export async function cached_result_async<T>(key: string, staleAfterSeconds: num cache[key].l = Temporal.Now.instant().epochSeconds; } - log_debug("Ran cached_result_async", { + console.debug("Ran cached_result_async", { cacheKey: key, isStale, cache: cache[key], @@ -34,5 +33,5 @@ export async function cached_result_async<T>(key: string, staleAfterSeconds: num export function clear_cache_key(key: string) { if (!key) throw new Error("No key was specified"); cache[key].c = undefined; - log_debug("Cleared cache with key: " + key); + console.debug("Cleared cache with key: " + key); }
\ No newline at end of file |
