Analytics: Verdichtung, Statistik, Heatmap-Daten

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-10-01 09:45:14 +00:00
1 parent 6233850bb3
commit 305939fdbd
9 files changed
+569 -2

No files matched your search

+5
View File
@@ -4,6 +4,7 @@ import { loadConfig } from './config.js';
import { openDb } from './db.js';
import { createSalt } from './salt.js';
import { loadGeo } from './geo.js';
import { scheduleNightly } from './jobs.js';
import { createPublicServer, createAdminServer } from './server.js';
const config = loadConfig(process.env);
@@ -22,7 +23,11 @@ for (const [name, server, port] of servers) {
server.listen(port, () => console.log(`Analytics-Dienst ${name} auf Port ${port}`));
}
// Nachtjob: täglich 02:30 Europe/Berlin und einmal 60 s nach dem Start
const nightly = scheduleNightly(db);
process.on('SIGTERM', () => {
nightly.stop();
let open = servers.length;
const done = () => { if (--open === 0) { db.close(); process.exit(0); } };
for (const [, server] of servers) { server.close(done); server.closeIdleConnections?.(); }