Skip to content

Commit

Permalink
fix: tune network asset queue configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Feb 19, 2024
1 parent 74769d8 commit b727706
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const logoUrl = 'https://avatars.githubusercontent.com/u/125477168?v=4'
prefix: 'pubkey:api',
connection: config.redisOptions,
defaultJobOptions: {
removeOnFail: { age: 24 * 3600 },
removeOnComplete: { age: 24 * 3600 },
removeOnFail: { age: 24 * 3600, count: 10_000 },
removeOnComplete: { age: 3600, count: 1000 },
keepLogs: 1000,
},
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface ApiNetworkAssetIdentitySyncPayload {
identity: Identity
}

@Processor(API_NETWORK_ASSET_SYNC, { concurrency: 8 })
@Processor(API_NETWORK_ASSET_SYNC, { concurrency: parseInt(process.env['SYNC_NETWORK_ASSETS_CONCURRENT'] || '2') })
export class ApiNetworkAssetSyncQueue extends WorkerHost {
private readonly logger = new Logger(ApiNetworkAssetSyncQueue.name)
constructor(private readonly core: ApiCoreService, private readonly sync: ApiNetworkAssetSyncService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ export interface ApiNetworkAssetUpsertPayload {
asset: NetworkAssetInput
}

@Processor(API_NETWORK_ASSET_UPSERT_QUEUE, { concurrency: 4 })
@Processor(API_NETWORK_ASSET_UPSERT_QUEUE, {
concurrency: parseInt(process.env['SYNC_NETWORK_ASSETS_CONCURRENT'] || '2'),
})
export class ApiNetworkAssetUpsertQueue extends WorkerHost {
private readonly logger = new Logger(ApiNetworkAssetUpsertQueue.name)
constructor(private readonly core: ApiCoreService, private readonly sync: ApiNetworkAssetSyncService) {
Expand Down

0 comments on commit b727706

Please sign in to comment.