keep completed jobs for up to 24 hours and failed jobs for 7 days

This commit is contained in:
Hongbo Wu
2024-02-06 14:21:00 +08:00
parent 53f63b90d7
commit 95fabe1dbf

View File

@ -54,8 +54,12 @@ export const getBackendQueue = async (): Promise<Queue | undefined> => {
type: 'exponential',
delay: 2000, // 2 seconds
},
removeOnComplete: true,
removeOnFail: true,
removeOnComplete: {
age: 24 * 3600, // keep up to 24 hours
},
removeOnFail: {
age: 7 * 24 * 3600, // keep up to 7 days
},
},
})
await backendQueue.waitUntilReady()