feat(queue): auto clean up complete and fail jobs

This commit is contained in:
Ali BARIN
2022-11-27 19:25:10 +01:00
parent 4240849a2a
commit 2e391cc651
5 changed files with 36 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import Context from '../../types/express/context';
import flowQueue from '../../queues/flow';
import { REMOVE_AFTER_30_DAYS_OR_150_JOBS, REMOVE_AFTER_7_DAYS_OR_50_JOBS } from '../../helpers/remove-job-configuration';
type Params = {
input: {
@@ -51,6 +52,8 @@ const updateFlowStatus = async (
{
repeat: repeatOptions,
jobId: flow.id,
removeOnComplete: REMOVE_AFTER_7_DAYS_OR_50_JOBS,
removeOnFail: REMOVE_AFTER_30_DAYS_OR_150_JOBS
}
);
} else {