Add configurable history and storage retention policies
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { pruneHistory, pruneSampleHistory } from '../retention.js';
|
||||
import { config } from '../config.js';
|
||||
import { processProvisioning } from '../provisioning/worker.js';
|
||||
import { sweep } from './sweep.js';
|
||||
@@ -51,13 +52,14 @@ function reconcileRequesters(): void {
|
||||
['campaign', 'Reconciling campaigns', sweep],
|
||||
['beta', 'Reconciling beta tests', betaTick],
|
||||
['maintenance', 'Checking maintenance and recovery', runMaintenance],
|
||||
['game-files', 'Removing unused game files', cleanupControllerLibraries]
|
||||
['game-files', 'Removing unused game files', cleanupControllerLibraries],
|
||||
['retention', 'Cleaning expired history', async () => { pruneHistory(); pruneSampleHistory(); }]
|
||||
];
|
||||
for (const [key, label, work] of requesters) {
|
||||
if (requesterFlights.has(key)) continue;
|
||||
const flight = trackActivity(key, label, work)
|
||||
.catch(err => { console.error(`[worker] ${key} error:`, err); })
|
||||
.then(async () => { if (key !== 'game-files') await tick(true); })
|
||||
.then(async () => { if (key !== 'game-files' && key !== 'retention') await tick(true); })
|
||||
.finally(() => { requesterFlights.delete(key); });
|
||||
requesterFlights.set(key, flight);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user