change k2v-only code
This commit is contained in:
parent
6ae8bbeb13
commit
e6ce8702d4
2 changed files with 2 additions and 3 deletions
|
@ -442,6 +442,7 @@ pub struct OfflineRepairOpt {
|
||||||
#[derive(Serialize, Deserialize, StructOpt, Debug, Eq, PartialEq, Clone)]
|
#[derive(Serialize, Deserialize, StructOpt, Debug, Eq, PartialEq, Clone)]
|
||||||
pub enum OfflineRepairWhat {
|
pub enum OfflineRepairWhat {
|
||||||
/// Repair K2V item counters
|
/// Repair K2V item counters
|
||||||
|
#[cfg(feature = "k2v")]
|
||||||
#[structopt(name = "k2v_item_counters")]
|
#[structopt(name = "k2v_item_counters")]
|
||||||
K2VItemCounters,
|
K2VItemCounters,
|
||||||
/// Repair object counters
|
/// Repair object counters
|
||||||
|
|
|
@ -29,14 +29,12 @@ pub async fn offline_repair(config_file: PathBuf, opt: OfflineRepairOpt) -> Resu
|
||||||
|
|
||||||
info!("Launching repair operation...");
|
info!("Launching repair operation...");
|
||||||
match opt.what {
|
match opt.what {
|
||||||
|
#[cfg(feature = "k2v")]
|
||||||
OfflineRepairWhat::K2VItemCounters => {
|
OfflineRepairWhat::K2VItemCounters => {
|
||||||
#[cfg(feature = "k2v")]
|
|
||||||
garage
|
garage
|
||||||
.k2v
|
.k2v
|
||||||
.counter_table
|
.counter_table
|
||||||
.offline_recount_all(&garage.k2v.item_table)?;
|
.offline_recount_all(&garage.k2v.item_table)?;
|
||||||
#[cfg(not(feature = "k2v"))]
|
|
||||||
error!("K2V not enabled in this build.");
|
|
||||||
}
|
}
|
||||||
OfflineRepairWhat::ObjectCounters => {
|
OfflineRepairWhat::ObjectCounters => {
|
||||||
garage
|
garage
|
||||||
|
|
Loading…
Reference in a new issue