@sidequest/engine
Version:
@sidequest/engine is the core engine of SideQuest, a distributed background job processing system for Node.js and TypeScript.
18 lines (14 loc) • 598 B
JavaScript
;
var core = require('@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);
core.logger("Engine").debug(`Deleting finished jobs older than ${cutoffDate.toISOString()}`);
await backend?.deleteFinishedJobs(cutoffDate);
}
exports.cleanupFinishedJobs = cleanupFinishedJobs;
//# sourceMappingURL=cleanup-finished-job.cjs.map