Skip to content

Commit

Permalink
Keep completed jobs for 3 days
Browse files Browse the repository at this point in the history
  • Loading branch information
srosset81 committed Dec 12, 2024
1 parent fab7a62 commit c8e2394
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const queueOptions =
process.env.NODE_ENV === 'test'
? {}
: {
// Keep completed jobs for 3 days
removeOnComplete: { age: 259200 },
// Try again after 3 minutes and until 48 hours later
// Method to calculate it: Math.round((Math.pow(2, attemptsMade) - 1) * delay)
attempts: 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
'processOutbox',
activity.id,
{ activity },
{ removeOnComplete: { age: 2629800 } } // Keep completed jobs for one month
{ removeOnComplete: { age: 259200 } } // Keep completed jobs for 3 days
);

await job.finished();
Expand All @@ -52,7 +52,7 @@ module.exports = {
'processInbox',
activity.id,
{ activity, recipients },
{ removeOnComplete: { age: 2629800 } } // Keep completed jobs for one month
{ removeOnComplete: { age: 259200 } } // Keep completed jobs for 3 days
);

await job.finished();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ const queueOptions =
process.env.NODE_ENV === 'test'
? {}
: {
// Keep completed jobs for 3 days
removeOnComplete: { age: 259200 },
// Try again after 3 minutes and until 48 hours later
// Method to calculate it: Math.round((Math.pow(2, attemptsMade) - 1) * delay)
attempts: 10,
Expand Down

0 comments on commit c8e2394

Please sign in to comment.