Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple pruning configurations #362

Merged
merged 1 commit into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions configuration/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,15 @@ type DataConfiguration struct {
// the results of a check:data run.
ResultsOutputFile string `json:"results_output_file"`

// PruningDisabled is a bolean that indicates storage pruning should
// PruningBlockDisabled is a boolean that indicates storage pruning should
// not be attempted. This should really only ever be set to true if you
// wish to use `start_index` at a later point to restart from some
// previously synced block.
PruningDisabled bool `json:"pruning_disabled"`
PruningBlockDisabled bool `json:"pruning_block_disabled"`

// PruningBalanceDisabled is a boolean that indicates balance pruning
// should not be attempted.
PruningBalanceDisabled bool `json:"pruning_balance_disabled"`

// PruningFrequency is the frequency (in seconds) that we attempt
// to prune blocks. If not populated, we use the default value
Expand Down
3 changes: 2 additions & 1 deletion examples/configuration/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"coin_tracking_disabled": false,
"status_port": 9090,
"results_output_file": "",
"pruning_disabled": false,
"pruning_block_disabled": false,
"pruning_balance_disabled": false,
"initial_balance_fetch_disabled": false
},
"perf": null
Expand Down
2 changes: 1 addition & 1 deletion pkg/processor/reconciler_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (h *ReconcilerHelper) PruneBalances(
currency *types.Currency,
index int64,
) error {
if h.config.Data.PruningDisabled {
if h.config.Data.PruningBalanceDisabled {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/tester/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func (t *DataTester) StartSyncing(
func (t *DataTester) StartPruning(
ctx context.Context,
) error {
if t.config.Data.PruningDisabled {
if t.config.Data.PruningBlockDisabled {
return nil
}

Expand Down