Skip to content

Commit

Permalink
Remove Bullboard from Prod
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Jun 28, 2024
1 parent 5361325 commit 724b9e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
12 changes: 8 additions & 4 deletions apps/armory/src/orchestration/orchestration.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ConfigModule } from '@narval/config-module'
import { HttpModule } from '@nestjs/axios'
import { BullModule } from '@nestjs/bull'
import { Module } from '@nestjs/common'
import { ConditionalModule } from '@nestjs/config'
import { load } from '../armory.config'
import { AUTHORIZATION_REQUEST_PROCESSING_QUEUE, DEFAULT_HTTP_MODULE_PROVIDERS } from '../armory.constant'
import { ClientModule } from '../client/client.module'
Expand Down Expand Up @@ -32,10 +33,13 @@ const INFRASTRUCTURE_MODULES = [
BullModule.registerQueue({
name: AUTHORIZATION_REQUEST_PROCESSING_QUEUE
}),
BullBoardModule.forFeature({
name: AUTHORIZATION_REQUEST_PROCESSING_QUEUE,
adapter: BullAdapter
})
ConditionalModule.registerWhen(
BullBoardModule.forFeature({
name: AUTHORIZATION_REQUEST_PROCESSING_QUEUE,
adapter: BullAdapter
}),
(env: NodeJS.ProcessEnv) => env.NODE_ENV === 'development'
)
]

const DOMAIN_MODULES = [ClientModule, TransferTrackingModule, PriceModule, DataFeedModule, PolicyEngineModule]
Expand Down
15 changes: 10 additions & 5 deletions apps/armory/src/shared/module/queue/queue.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { BullBoardModule } from '@bull-board/nestjs'
import { ConfigService } from '@narval/config-module'
import { BullModule } from '@nestjs/bull'
import { DynamicModule } from '@nestjs/common'
import { Config, Env } from '../../../armory.config'
import { ConditionalModule, ConfigModule } from '@nestjs/config'
import { Config, Env, load } from '../../../armory.config'
import { QUEUE_PREFIX } from '../../../armory.constant'

export type RegisterQueueOption = {
Expand All @@ -17,6 +18,7 @@ export class QueueModule {
return {
module: QueueModule,
imports: [
ConfigModule.forRoot({ load: [load] }),
BullModule.forRootAsync({
inject: [ConfigService],
useFactory: async (configService: ConfigService<Config>) => {
Expand All @@ -28,10 +30,13 @@ export class QueueModule {
}
}
}),
BullBoardModule.forRoot({
route: '/admin/queues',
adapter: ExpressAdapter
})
ConditionalModule.registerWhen(
BullBoardModule.forRoot({
route: '/admin/queues',
adapter: ExpressAdapter
}),
(env: NodeJS.ProcessEnv) => env.NODE_ENV === 'development'
)
]
}
}
Expand Down

0 comments on commit 724b9e0

Please sign in to comment.