From 5ca4143e787342a5ef1f151fcfe993dc3a9f4132 Mon Sep 17 00:00:00 2001 From: kanshi <46557+kanshi@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:22:22 +0200 Subject: [PATCH] Tweak BullMQ stream size on all queues --- src/events/events.module.ts | 10 ++++++++-- src/tasks/tasks.module.ts | 22 +++++++++++++++++----- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/events/events.module.ts b/src/events/events.module.ts index 9e263d3..82abf57 100644 --- a/src/events/events.module.ts +++ b/src/events/events.module.ts @@ -12,9 +12,15 @@ import { VerificationModule } from 'src/verification/verification.module' DistributionModule, VerificationModule, ClusterModule, - BullModule.registerQueue({ name: 'facilitator-updates-queue' }), + BullModule.registerQueue({ + name: 'facilitator-updates-queue', + streams: { events: { maxLen: 2000 } } + }), BullModule.registerFlowProducer({ name: 'facilitator-updates-flow' }), - BullModule.registerQueue({ name: 'registrator-updates-queue' }), + BullModule.registerQueue({ + name: 'registrator-updates-queue', + streams: { events: { maxLen: 5000 } } + }), BullModule.registerFlowProducer({ name: 'registrator-updates-flow' }), ], providers: [EventsService, FacilitatorUpdatesQueue, RegistratorUpdatesQueue], diff --git a/src/tasks/tasks.module.ts b/src/tasks/tasks.module.ts index 6905d1f..0643e58 100644 --- a/src/tasks/tasks.module.ts +++ b/src/tasks/tasks.module.ts @@ -24,17 +24,29 @@ import { ClusterModule } from 'src/cluster/cluster.module' DistributionModule, ChecksModule, ClusterModule, - BullModule.registerQueue({ name: 'tasks-queue' }), + BullModule.registerQueue({ + name: 'tasks-queue', + streams: { events: { maxLen: 1000 } } + }), BullModule.registerQueue({ name: 'validation-queue', - streams: { events: { maxLen: 5000 } } + streams: { events: { maxLen: 1000 } } }), BullModule.registerFlowProducer({ name: 'validation-flow' }), - BullModule.registerQueue({ name: 'verification-queue' }), + BullModule.registerQueue({ + name: 'verification-queue', + streams: { events: { maxLen: 1000 } } + }), BullModule.registerFlowProducer({ name: 'verification-flow' }), - BullModule.registerQueue({ name: 'distribution-queue' }), + BullModule.registerQueue({ + name: 'distribution-queue', + streams: { events: { maxLen: 5000 } } + }), BullModule.registerFlowProducer({ name: 'distribution-flow' }), - BullModule.registerQueue({ name: 'balance-checks-queue' }), + BullModule.registerQueue({ + name: 'balance-checks-queue', + streams: { events: { maxLen: 500 } } + }), BullModule.registerFlowProducer({ name: 'balance-checks-flow' }), MongooseModule.forFeature([ {