Merge pull request #5422 from overleaf/ab-queues-default-job-options

Add default job options for queues in analytics

GitOrigin-RevId: ab8cf13a0ba35acb0b21519f21131df128bb3f29
This commit is contained in:
Alexandre Bourdin 2021-10-12 16:00:43 +02:00 committed by Copybot
parent 96d9e6578a
commit da6d6abe80

View file

@ -42,6 +42,8 @@ function getPostRegistrationAnalyticsQueue() {
function getOrCreateQueue(queueName, jobOptions = {}) {
if (!queues[queueName]) {
queues[queueName] = new Queue(queueName, {
// this configuration is duplicated in /services/analytics/app/js/Queues.js
// and needs to be manually kept in sync whenever modified
redis: Settings.redis.queues,
defaultJobOptions: {
removeOnComplete: MAX_COMPLETED_JOBS_RETAINED,