import { readRunning } from "@/lib/activity"; export const dynamic = "force-dynamic"; // The rail's Running list (lib/activity.ts readRunning): umtool's own jobs and // the editor's live ones, the rows chosen, the rest folded, spend and the day's // total. Never an error status for the editor's sake: an editor that cannot be // asked is `editor.reason` in a 200, and umtool's own jobs still list. // `?fresh=1` asks the editor again instead of taking its answer of the last 2 s. export async function GET(request: Request) { const fresh = new URL(request.url).searchParams.get("fresh") === "1"; try { return Response.json(await readRunning({ fresh }), { headers: { "cache-control": "no-store" } }); } catch (err) { return Response.json({ error: (err as Error).message }, { status: 500, headers: { "cache-control": "no-store" } }); } }