batch up usage records for insert

This commit is contained in:
Owen
2026-08-11 11:10:30 -04:00
parent b33e776072
commit b60390d805
3 changed files with 108 additions and 2 deletions
+2
View File
@@ -3,12 +3,14 @@ import { flushConnectionLogToDb } from "#dynamic/routers/newt";
import { flushSiteBandwidthToDb } from "@server/routers/gerbil/receiveBandwidth";
import { stopPingAccumulator } from "@server/routers/newt/pingAccumulator";
import { cleanup as wsCleanup } from "#dynamic/routers/ws";
import { shutdownUsageRecorder } from "@server/lib/aiBudgetEnforcement";
async function cleanup() {
await stopPingAccumulator();
await flushBandwidthToDb();
await flushConnectionLogToDb();
await flushSiteBandwidthToDb();
await shutdownUsageRecorder();
await wsCleanup();
process.exit(0);