Analytics: Verdichtung, Statistik, Heatmap-Daten
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6233850bb3
commit
305939fdbd
9 files changed
+569
-2
No files matched your search
@@ -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?.(); }
|
||||
|
||||
Reference in new issue
Block a user