fix the deletion of the data.ms in case of errors

This commit is contained in:
Tamo 2022-10-16 03:04:17 +02:00 committed by Clément Renault
parent 9b96085327
commit 54d4d364c2
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
2 changed files with 17 additions and 13 deletions

View file

@ -48,13 +48,7 @@ async fn main() -> anyhow::Result<()> {
_ => unreachable!(),
}
let (index_scheduler, auth_controller) = match setup_meilisearch(&opt) {
Ok(ret) => ret,
Err(e) => {
std::fs::remove_dir_all(opt.db_path)?;
return Err(e);
}
};
let (index_scheduler, auth_controller) = setup_meilisearch(&opt)?;
#[cfg(all(not(debug_assertions), feature = "analytics"))]
let analytics = if !opt.no_analytics {