Răsfoiți Sursa

Merge pull request #3648 from overleaf/em-failed-jobs-limit

Limit the number of failed jobs in bull queues

GitOrigin-RevId: 39a9c1385f9f8abadff236f5be35a96ca6a24208
Jakob Ackermann 5 ani în urmă
părinte
comite
f4df3df703
1 a modificat fișierele cu 2 adăugiri și 0 ștergeri
  1. 2 0
      services/web/app/src/infrastructure/Queues.js

+ 2 - 0
services/web/app/src/infrastructure/Queues.js

@@ -7,6 +7,7 @@ const analyticsQueues = {}
 // useful to inspect recently completed jobs. The bull prometheus exporter also
 // useful to inspect recently completed jobs. The bull prometheus exporter also
 // uses the completed job records to report on job duration.
 // uses the completed job records to report on job duration.
 const MAX_COMPLETED_JOBS_RETAINED = 10000
 const MAX_COMPLETED_JOBS_RETAINED = 10000
+const MAX_FAILED_JOBS_RETAINED = 50000
 
 
 function initialize() {
 function initialize() {
   if (Settings.analytics.enabled) {
   if (Settings.analytics.enabled) {
@@ -20,6 +21,7 @@ function createQueue(queueName, defaultJobOptions) {
     redis: Settings.redis.queues,
     redis: Settings.redis.queues,
     defaultJobOptions: {
     defaultJobOptions: {
       removeOnComplete: MAX_COMPLETED_JOBS_RETAINED,
       removeOnComplete: MAX_COMPLETED_JOBS_RETAINED,
+      removeOnFail: MAX_FAILED_JOBS_RETAINED,
       attempts: 11,
       attempts: 11,
       backoff: {
       backoff: {
         type: 'exponential',
         type: 'exponential',