fix(web): harden timeline sse reconnect lifecycle

This commit is contained in:
2026-03-31 23:06:07 +02:00
parent 73ef3b2bba
commit c3b3dffb6e
2 changed files with 25 additions and 6 deletions
+4 -3
View File
@@ -5,13 +5,14 @@ import { prisma } from "@capakraken/db";
import { SSE_EVENT_TYPES, SystemRole, type PermissionOverrides } from "@capakraken/shared";
import { auth } from "~/server/auth.js";
// Start the reminder scheduler (idempotent — only starts once)
startReminderScheduler();
export const dynamic = "force-dynamic";
export const runtime = "nodejs";
export async function GET() {
// Start lazily on the first real SSE request so builds/import-time evaluation
// never attempt reminder processing against a live database.
startReminderScheduler();
const session = await auth();
if (!session?.user) {