record more logs from Background Queue

This commit is contained in:
Hazelnoot 2025-09-17 12:31:36 -04:00
parent e81c8b075b
commit d2a20fcccd
2 changed files with 10 additions and 9 deletions

View file

@ -940,15 +940,6 @@ export class QueueService implements OnModuleInit {
data.type,
data,
{
removeOnComplete: {
age: 3600 * 24 * 7, // keep up to 7 days
count: 30,
},
removeOnFail: {
age: 3600 * 24 * 7, // keep up to 7 days
count: 100,
},
// https://docs.bullmq.io/guide/retrying-failing-jobs#custom-back-off-strategies
attempts: this.config.backgroundJobMaxAttempts ?? 8,
backoff: {

View file

@ -591,6 +591,16 @@ export class QueueProcessorService implements OnApplicationShutdown {
settings: {
backoffStrategy: httpRelatedBackoff,
},
// Keep a lot of jobs, because this queue moves *fast*!
// https://docs.bullmq.io/guide/workers/auto-removal-of-jobs
removeOnComplete: {
age: 3600 * 24 * 7, // keep up to 7 days
count: 1000,
},
removeOnFail: {
age: 3600 * 24 * 7, // keep up to 7 days
count: 1000,
},
});
this.backgroundTaskWorker
.on('active', (job) => logger.debug(`active id=${job.id}`))