From e6ce8702d452bf12929c7f5bc022ecde9ed56f21 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 10 Jun 2022 11:08:23 +0200 Subject: change k2v-only code --- src/garage/cli/structs.rs | 1 + src/garage/repair/offline.rs | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/garage') diff --git a/src/garage/cli/structs.rs b/src/garage/cli/structs.rs index 28228b07..4f2efe19 100644 --- a/src/garage/cli/structs.rs +++ b/src/garage/cli/structs.rs @@ -442,6 +442,7 @@ pub struct OfflineRepairOpt { #[derive(Serialize, Deserialize, StructOpt, Debug, Eq, PartialEq, Clone)] pub enum OfflineRepairWhat { /// Repair K2V item counters + #[cfg(feature = "k2v")] #[structopt(name = "k2v_item_counters")] K2VItemCounters, /// Repair object counters diff --git a/src/garage/repair/offline.rs b/src/garage/repair/offline.rs index ef56cc5c..7760a8bd 100644 --- a/src/garage/repair/offline.rs +++ b/src/garage/repair/offline.rs @@ -29,14 +29,12 @@ pub async fn offline_repair(config_file: PathBuf, opt: OfflineRepairOpt) -> Resu info!("Launching repair operation..."); match opt.what { + #[cfg(feature = "k2v")] OfflineRepairWhat::K2VItemCounters => { - #[cfg(feature = "k2v")] garage .k2v .counter_table .offline_recount_all(&garage.k2v.item_table)?; - #[cfg(not(feature = "k2v"))] - error!("K2V not enabled in this build."); } OfflineRepairWhat::ObjectCounters => { garage -- cgit v1.2.3