mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
HealthLog — personal health-tracking PWA with weight, blood pressure, pulse, mood tracking, medication compliance, Withings integration, doctor report PDF export, and Dracula-themed UI.
18 lines
553 B
TypeScript
18 lines
553 B
TypeScript
/**
|
|
* Global pg-boss instance accessor.
|
|
* Uses globalThis to share the instance across Turbopack chunks.
|
|
* Set by the reminder worker on startup, read by notification senders
|
|
* for scheduling delayed cleanup jobs.
|
|
*/
|
|
import type { PgBoss } from "pg-boss";
|
|
|
|
const BOSS_KEY = "__healthlog_pgboss__" as const;
|
|
|
|
export function setGlobalBoss(boss: PgBoss) {
|
|
(globalThis as Record<string, unknown>)[BOSS_KEY] = boss;
|
|
}
|
|
|
|
export function getGlobalBoss(): PgBoss | null {
|
|
return ((globalThis as Record<string, unknown>)[BOSS_KEY] as PgBoss) ?? null;
|
|
}
|