Minor tweaks

This commit is contained in:
G2-Games 2024-10-22 13:10:14 -05:00
parent 4ff2d2496d
commit 80a4c767a8
2 changed files with 4 additions and 2 deletions

View file

@ -42,7 +42,7 @@ impl Database {
let mut out_path = self.path.clone();
out_path.set_extension(".bkp");
let mut file = File::create(&out_path).expect("Could not save!");
encode_into_std_write(&self, &mut file, BINCODE_CFG).expect("Could not write out!");
encode_into_std_write(self, &mut file, BINCODE_CFG).expect("Could not write out!");
fs::rename(out_path, &self.path).unwrap();
}

View file

@ -154,6 +154,8 @@ fn clean_database(db: &Arc<RwLock<Database>>) {
debug!("Deleted file: {}", file.1.name());
database.files.remove(&file.0);
}
database.save();
}
#[rocket::main]
@ -165,7 +167,7 @@ async fn main() {
let (shutdown, mut rx) = tokio::sync::mpsc::channel(1);
let cleaner_db = database.clone();
spawn(async move {
let mut interval = time::interval(Duration::from_secs(60));
let mut interval = time::interval(Duration::from_secs(120));
loop {
select! {