Browse Source

fud: flush sled on exit

epiphany 1 year ago
parent
commit
386f3907c2
1 changed files with 5 additions and 1 deletions
  1. 5 1
      bin/fud/fud/src/main.rs

+ 5 - 1
bin/fud/fud/src/main.rs

@@ -291,6 +291,10 @@ async fn realmain(args: Args, ex: Arc<Executor<'static>>) -> Result<()> {
     dht_disconnect_task.stop().await;
     dht_disconnect_task.stop().await;
     announce_task.stop().await;
     announce_task.stop().await;
 
 
-    info!("Bye!");
+    info!(target: "fud", "Flushing sled database...");
+    let flushed_bytes = sled_db.flush_async().await?;
+    info!(target: "fud", "Flushed {} bytes", flushed_bytes);
+
+    info!(target: "fud", "Shut down successfully");
     Ok(())
     Ok(())
 }
 }