Skip to main content

tuwunel_database/engine/
repair.rs

1use std::path::PathBuf;
2
3use rocksdb::Options;
4use tuwunel_core::{Err, Result, info, warn};
5
6use super::Db;
7
8pub(crate) fn repair(db_opts: &Options, path: &PathBuf) -> Result {
9	warn!("Starting database repair. This may take a long time...");
10	match Db::repair(db_opts, path) {
11		| Ok(()) => info!("Database repair successful."),
12		| Err(e) => return Err!("Repair failed: {e:?}"),
13	}
14
15	Ok(())
16}