Scope live chat to the current match and save match history

This commit is contained in:
2026-10-07 00:40:20 -04:00
parent 8fcabe27fc
commit 2b8e102b86
14 changed files with 266 additions and 30 deletions
+3 -1
View File
@@ -1,4 +1,5 @@
import { pruneHistory, pruneSampleHistory } from '../retention.js';
import { collectFleetChat } from '../fleet/chat.js';
import { runAutoscaling, pruneAutoscaling } from '../autoscaling/index.js';
import { config } from '../config.js';
import { processProvisioning } from '../provisioning/worker.js';
@@ -57,6 +58,7 @@ function reconcileRequesters(): void {
['maintenance', 'Checking maintenance and recovery', runMaintenance],
['autoscaling', 'Evaluating lobby autoscaling', runAutoscaling],
['game-files', 'Removing unused game files', cleanupControllerLibraries],
['chat', 'Saving match chat', collectFleetChat],
['retention', 'Cleaning expired history', async () => { pruneHistory(); pruneSampleHistory(); pruneAutoscaling(); }]
];
for (const [key, label, work] of requesters) {
@@ -67,7 +69,7 @@ function reconcileRequesters(): void {
}
const flight = trackActivity(key, label, work)
.catch(err => { console.error(`[worker] ${key} error:`, err); })
.then(async result => { if (key !== 'game-files' && key !== 'retention' && (key !== 'autoscaling' || result === true)) await tick(true); })
.then(async result => { if (key !== 'game-files' && key !== 'retention' && key !== 'chat' && (key !== 'autoscaling' || result === true)) await tick(true); })
.finally(() => { requesterFlights.delete(key); });
requesterFlights.set(key, flight);
}