From 717de6684abe5827ee16a85db44ce525c0bf8eb8 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 9 Jan 2022 19:24:52 +0100 Subject: [PATCH] Add simple sleep after shutdown command to allow a full repository shutdown Signed-off-by: trivernis --- mediarepo-api/src/tauri_plugin/commands/repo.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mediarepo-api/src/tauri_plugin/commands/repo.rs b/mediarepo-api/src/tauri_plugin/commands/repo.rs index a8a3373..beca33a 100644 --- a/mediarepo-api/src/tauri_plugin/commands/repo.rs +++ b/mediarepo-api/src/tauri_plugin/commands/repo.rs @@ -144,6 +144,8 @@ pub async fn close_local_repository( if let Err(e) = api.shutdown_daemon().await { tracing::error!("failed to ask the daemon to shut down daemon {:?}", e); } + // allow the repository to gracefully stop within 1 second + tokio::time::sleep(Duration::from_secs(1)).await; } app_state.stop_running_daemon(&path).await?; }