@sidequest/engine
Version:
@sidequest/engine is the core engine of SideQuest, a distributed background job processing system for Node.js and TypeScript.
16 lines (13 loc) • 561 B
JavaScript
import { logger } from '@sidequest/core';
/**
* Deletes finished jobs older than one month from the backend.
* @param backend The backend instance to operate on.
* @param cutoffMs The cutoff time in milliseconds.
*/
async function cleanupFinishedJobs(backend, cutoffMs) {
const cutoffDate = new Date(Date.now() - cutoffMs);
logger("Engine").debug(`Deleting finished jobs older than ${cutoffDate.toISOString()}`);
await backend?.deleteFinishedJobs(cutoffDate);
}
export { cleanupFinishedJobs };
//# sourceMappingURL=cleanup-finished-job.js.map