Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
600 B ยท 23 lines
TypeScript
123456789101112131415161718192021222324import { after } from "next/server.js";
/** * Follow-ups that run after the response is sent. The mutation they follow * is already committed, so a failure is only logged under `label`. Outside a * request scope (tests, scripts) `after` throws and the task runs right away. */export function createAfterResponse(label: string) { return (task: () => Promise<unknown>) => { const run = async () => { try { await task(); } catch (err) { console.warn(`${label} failed`, err); } }; try { after(run); } catch { void run(); } };}