From 7088768dac2f8e226c0dd06ea51cc05786463685 Mon Sep 17 00:00:00 2001 From: "unmaykr (aftermath)" <98741738+unmaykr-aftermath@users.noreply.github.com> Date: Sun, 5 Jan 2025 15:01:57 -0300 Subject: [PATCH] fix(sui-indexer): allow setting --gc-checkpoint-files=false 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](https://github.com/clap-rs/clap/issues/1649#issuecomment-2144879038) --- crates/sui-indexer/src/config.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/sui-indexer/src/config.rs b/crates/sui-indexer/src/config.rs index 9d9f7d7e64304..6ba16d7b8560c 100644 --- a/crates/sui-indexer/src/config.rs +++ b/crates/sui-indexer/src/config.rs @@ -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, }