Reconnect SSE connection if we miss heartbeats for 30 seconds
Some checks failed
/ golint (push) Failing after 10s

Issue: #11
This commit is contained in:
Eli Ribble 2026-05-21 15:43:56 +00:00
parent 03d40774cb
commit 614f4d274e
No known key found for this signature in database
2 changed files with 52 additions and 4 deletions

22
ts/log.ts Normal file
View file

@ -0,0 +1,22 @@
// log.ts
const pageLoadTime = performance.now();
function getTimestamp(): string {
const elapsed = performance.now() - pageLoadTime;
const hours = Math.floor(elapsed / 3600000);
const minutes = Math.floor((elapsed % 3600000) / 60000);
const seconds = Math.floor((elapsed % 60000) / 1000);
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
}
export const log = {
info(...args: any[]): void {
console.log(`[${getTimestamp()}]`, ...args);
},
error(...args: any[]): void {
console.error(`[${getTimestamp()}]`, ...args);
},
};