Skip to content

Commit

Permalink
Merge pull request #362 from GeekArthur/pruningFlag
Browse files Browse the repository at this point in the history
Decouple pruning configurations
  • Loading branch information
GeekArthur authored Sep 19, 2022
2 parents 03cf522 + 27df049 commit 7bb7304
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
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

0 comments on commit 7bb7304

Please sign in to comment.