From b546329a9c2680f92c3376e200aa686c28c9151b Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Mon, 5 Dec 2022 00:51:11 +0800 Subject: [PATCH] keep db --- cozo-core/benches/pokec.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cozo-core/benches/pokec.rs b/cozo-core/benches/pokec.rs index c928a663..fe5fcef8 100644 --- a/cozo-core/benches/pokec.rs +++ b/cozo-core/benches/pokec.rs @@ -45,10 +45,13 @@ lazy_static! { .parse::() .unwrap(); db_path.push(format!("{}-{}.db", db_kind, data_size)); - let _ = std::fs::remove_file(&db_path); - let _ = std::fs::remove_dir_all(&db_path); - + // let _ = std::fs::remove_file(&db_path); + // let _ = std::fs::remove_dir_all(&db_path); + let path_exists = Path::exists(db_path); let db = DbInstance::new(&db_kind, db_path.to_str().unwrap(), "").unwrap(); + if path_exists { + return db + } let mut backup_path = data_dir.clone(); backup_path.push(format!("backup-{}.db", data_size));