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

Commit

Permalink
🔧 Re-configure missing blocks job to run every 5 minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
sameersubudhi committed Nov 29, 2023
1 parent 1da8eea commit feb052e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docker/example.env
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ ENABLE_PERSIST_EVENTS=false
# INDEX_MISSING_BLOCKS_SKIP_THRESHOLD=1000
# INDEX_MISSING_BLOCKS_MAX_SCHEDULE=25000
# JOB_INTERVAL_INDEX_MISSING_BLOCKS=0
# JOB_SCHEDULE_INDEX_MISSING_BLOCKS='* * * * *'
# JOB_SCHEDULE_INDEX_MISSING_BLOCKS='*/5 * * * *'

## Lisk Service Fee Estimator
ENABLE_FEE_ESTIMATOR_QUICK=true
Expand Down
6 changes: 3 additions & 3 deletions docs/antora/modules/ROOT/pages/configuration/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,8 @@ By default, it is set to `0`.
| `JOB_SCHEDULE_INDEX_MISSING_BLOCKS`
| string
| Job run cron schedule to index missing blocks.
By default, it is set to run every minute.
| * * * * *
By default, it is set to run every 5 minutes.
| */5 * * * *
|===

.Sample Configurations
Expand All @@ -564,7 +564,7 @@ module.exports = {
// SERVICE_LOG_FILE: false,
// DOCKER_HOST: 'local',
// JOB_INTERVAL_INDEX_MISSING_BLOCKS: 0,
// JOB_SCHEDULE_INDEX_MISSING_BLOCKS: '* * * * *',
// JOB_SCHEDULE_INDEX_MISSING_BLOCKS: '*/5 * * * *',
},
},
// Configuration for other microservices.
Expand Down
2 changes: 1 addition & 1 deletion ecosystem.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ module.exports = {
// INDEX_MISSING_BLOCKS_SKIP_THRESHOLD: 1000,
// INDEX_MISSING_BLOCKS_MAX_SCHEDULE: 25000,
// JOB_INTERVAL_INDEX_MISSING_BLOCKS: 0,
// JOB_SCHEDULE_INDEX_MISSING_BLOCKS: '* * * * *',
// JOB_SCHEDULE_INDEX_MISSING_BLOCKS: '*/5 * * * *',
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-coordinator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ A list of the most commonly used environment variables is presented below:
- `SERVICE_BROKER`: URL of the microservice message broker (NATS or Redis).
- `SERVICE_MESSAGE_QUEUE_REDIS`: URL of the job queue to schedule the indexing jobs (Redis).
- `JOB_INTERVAL_INDEX_MISSING_BLOCKS`: Job run interval to index missing blocks. By default, it is set to 0.
- `JOB_SCHEDULE_INDEX_MISSING_BLOCKS`: Job run cron schedule to index missing blocks. By default, it is set to run every minute (`* * * * *`).
- `JOB_SCHEDULE_INDEX_MISSING_BLOCKS`: Job run cron schedule to index missing blocks. By default, it is set to run every 5 minutes (`*/5 * * * *`).

> **Note**: `interval` takes priority over `schedule` and must be greater than 0 to be valid for all the moleculer job configurations.
Expand Down
2 changes: 1 addition & 1 deletion services/blockchain-coordinator/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ config.job = {
// Interval takes priority over schedule and must be greater than 0 to be valid
indexMissingBlocks: {
interval: Number(process.env.JOB_INTERVAL_INDEX_MISSING_BLOCKS) || 0,
schedule: process.env.JOB_SCHEDULE_INDEX_MISSING_BLOCKS || '* * * * *',
schedule: process.env.JOB_SCHEDULE_INDEX_MISSING_BLOCKS || '*/5 * * * *',
skipThreshold: Number(process.env.INDEX_MISSING_BLOCKS_SKIP_THRESHOLD) || 1000,
maxBlocksToSchedule: Number(process.env.INDEX_MISSING_BLOCKS_MAX_SCHEDULE) || 25000,
},
Expand Down

0 comments on commit feb052e

Please sign in to comment.