b2c1642065
Each user in the leaderboard links to a profile page showing stat cards, a line chart (requests / storage / watch hours, 1W–1Y timeframes, raw or normalized, plus a Storage Load mode), and a full request history sorted newest-first. Includes Overseerr media status codes (1–5), Tautulli watch history aggregation, and a server-side raw cache so the user API route can enrich requests without re-fetching everything. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
15 lines
524 B
TypeScript
15 lines
524 B
TypeScript
/**
|
|
* Next.js instrumentation hook — runs once when the server starts.
|
|
* Used to kick off the background stats poller so alerts are generated
|
|
* and Discord notifications are sent even when no client is connected.
|
|
*/
|
|
|
|
export async function register() {
|
|
// Only run in the Node.js runtime (not Edge).
|
|
// better-sqlite3 and the fetch clients require Node.js APIs.
|
|
if (process.env.NEXT_RUNTIME === "edge") return;
|
|
|
|
const { startBackgroundPoller } = await import("@/lib/statsBuilder");
|
|
startBackgroundPoller();
|
|
}
|