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
@@ -18,12 +18,14 @@ import { flushBandwidthToDb } from "@server/routers/newt/handleReceiveBandwidthM
import { flushConnectionLogToDb } from "#private/routers/newt";
import { flushSiteBandwidthToDb } from "@server/routers/gerbil/receiveBandwidth";
import { stopPingAccumulator } from "@server/routers/newt/pingAccumulator";
import { shutdownUsageRecorder } from "@server/lib/aiBudgetEnforcement";
async function cleanup() {
await stopPingAccumulator();
await flushBandwidthToDb();
await flushConnectionLogToDb();
await flushSiteBandwidthToDb();
await shutdownUsageRecorder();
await rateLimitService.cleanup();
await wsCleanup();
await logStreamingManager.shutdown();