From 6ce7384c8a26ba170e4dc50bd78d221f98357bac Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 14 Dec 2024 21:50:49 +0100 Subject: [PATCH] background scan --- src/main.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index f792c4e..c0aa54a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,9 +49,11 @@ async fn launch() -> _ { let library = lib.clone(); - library - .scan_dir(&Path::new(&dir_path.clone()).to_path_buf()) - .await; + let handle = tokio::spawn(async move { + library + .scan_dir(&Path::new(&dir_path.clone()).to_path_buf()) + .await; + }); let cors = rocket_cors::CorsOptions { allowed_origins: rocket_cors::AllowedOrigins::all(),