Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
🔧 Limit indexing pace to assist in app node performance
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Jan 26, 2024
1 parent 1f8ec22 commit 5dc2596
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions services/blockchain-indexer/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@ config.queue = {
name: 'IndexBlocks',
concurrency: 1,
scheduledJobsMaxCount: Number(process.env.INDEX_BLOCKS_QUEUE_SCHEDULED_JOB_MAX_COUNT) || 100000,
options: {
defaultJobOptions: {
attempts: 5,
timeout: 5 * 60 * 1000, // millisecs
removeOnComplete: true,
removeOnFail: true,
stackTraceLimit: 0,
},
limiter: {
max: 600,
duration: 1 * 60 * 1000,
},
},
},
indexAccountPublicKey: {
name: 'PendingPublickeyUpdates',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,7 @@ const initBlockProcessingQueues = async () => {
config.queue.indexBlocks.name,
indexBlock,
config.queue.indexBlocks.concurrency,
config.queue.indexBlocks.options,
);

deleteIndexedBlocksQueue = Queue(
Expand Down
6 changes: 5 additions & 1 deletion services/export/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ config.queue = {
options: {
defaultJobOptions: {
attempts: 5,
timeout: 15 * 60 * 1000, // millisecs
backoff: {
type: 'exponential',
delay: 1 * 60 * 1000, // millisecs
},
timeout: 5 * 60 * 1000, // millisecs
removeOnComplete: true,
removeOnFail: true,
stackTraceLimit: 0,
Expand Down

0 comments on commit 5dc2596

Please sign in to comment.