Files
tyx_AI_xhs/apps/worker/src/storage-maintenance.ts

11 lines
436 B
TypeScript

export interface StorageMaintenanceTarget {
processCleanupQueue(): Promise<{ completed: number; failed: number }>;
reconcileStartup(): Promise<{ orphaned: number; released_reservations: number }>;
}
export async function runStorageMaintenance(target: StorageMaintenanceTarget) {
const reconciliation = await target.reconcileStartup();
const cleanup = await target.processCleanupQueue();
return { cleanup, reconciliation };
}