feat(sv-publisher): Add historical interval configuration #479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new configuration option for historical gap processing intervals, refactors logging to use structured tracing, and enhances the flexibility of periodic tasks. The most important changes include adding the
history_interval
parameter to the CLI, enabling dynamic control of historical gap processing intervals, and replacingprintln!
statements withtracing::info!
for improved logging.Configuration Enhancements:
services/publisher/src/cli.rs
: Added a new CLI argumenthistory_interval
to configure the interval for processing historical gaps. The default value is set to 259200 seconds (3 days), with an option to disable by setting it to 0.Periodic Task Improvements:
services/publisher/src/history.rs
: Updatedprocess_historical_gaps_periodically
to dynamically adjust the interval based on the newhistory_interval
parameter. If the interval is set to 0, the task is disabled and logs a message indicating this.services/publisher/src/main.rs
: Modified theprocess_historical_gaps_periodically
invocation inmain
to use thehistory_interval
parameter from the CLI.Logging Refactor:
services/publisher/src/recover.rs
: Replacedprintln!
statements withtracing::info!
for structured and consistent logging infetch_transaction_chunk
andrecover_tx_pointers
. [1] [2]