Skip to content

Commit

Permalink
fix(sui-indexer): allow setting --gc-checkpoint-files=false
Browse files Browse the repository at this point in the history
Previously I was unable to turn off checkpoint file garbage collection,
since the default value was `true`, the `--gc-checkpoint-files` flag
didn't expect any values and the default `clap` action was to set the
value to `true` when the flag was present. I've tried all of:

- `--gc-checkpoint-files 0`
- `--gc-checkpoint-files false`
- `--gc-checkpoint-files=0`
- `--gc-checkpoint-files=false`

This changes that so that the `false` value is accepted by the argument.
It is based on this [comment](clap-rs/clap#1649 (comment))
  • Loading branch information
unmaykr-aftermath committed Jan 5, 2025
1 parent 232d616 commit 7088768
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/sui-indexer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ pub struct IngestionConfig {

/// Whether to delete processed checkpoint files from the local directory,
/// when running Fullnode-colocated indexer.
#[arg(long, default_value_t = true)]
#[arg(
long,
default_value_t = true,
default_missing_value = "true",
num_args = 0..=1,
require_equals = false,
)]
pub gc_checkpoint_files: bool,
}

Expand Down

0 comments on commit 7088768

Please sign in to comment.