aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/lib/server/session-log.ts
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/lib/server/session-log.ts')
-rw-r--r--app/src/lib/server/session-log.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/src/lib/server/session-log.ts b/app/src/lib/server/session-log.ts
new file mode 100644
index 0000000..1195621
--- /dev/null
+++ b/app/src/lib/server/session-log.ts
@@ -0,0 +1,14 @@
+import { Temporal } from "temporal-polyfill"
+import { db } from "./db"
+import { syncLog } from "./db/schema"
+
+export type SessionLogType = "CREATED" | "SYNC_START" | "REFRESH_SB1_TOKEN"
+
+export async function add_session_log(id: string, type: SessionLogType, msg: string) {
+ db.insert(syncLog).values({
+ dateTime: String(Temporal.Now.instant().epochMilliseconds),
+ sessionId: id,
+ type: type,
+ msg: msg
+ })
+} \ No newline at end of file