Make prune batch size configurable #964
Merged
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.
Make prune batch size configurable by adding BatchSize field to PruneConfig struct and updating DeleteExpiredEnvelopesBatch function to accept parameterized batch size
Adds a configurable
BatchSizefield to thePruneConfigstruct with a default value of 10000, accessible via--batch-sizecommand line flag andXMTPD_PRUNE_BATCH_SIZEenvironment variable. The changes include:DeleteExpiredEnvelopesBatchfunction in pkg/db/queries/prune.sql.go to accept abatchSizeparameter instead of using a hardcoded limit of 1000@batch_sizeinstead of hardcoded LIMIT 1000NewPruneExecutorfunction in pkg/prune/prune.go to ensure BatchSize is greater than 0📍Where to Start
Start with the
PruneConfigstruct in pkg/config/pruneOptions.go to understand the new configuration field, then review theNewPruneExecutorfunction in pkg/prune/prune.go to see how the configuration is validated and used.Changes since #964 opened
Macroscope summarized 023bf46.