From b81bf99cc2e71ea710c4be078a74e40a3e456869 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 29 Nov 2024 13:01:54 +0100 Subject: [PATCH] prettify cache msg --- backend/windmill-worker/src/python_executor.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index f87b5bcb29..4127af7f7b 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -1432,6 +1432,7 @@ pub async fn handle_python_reqs( let mut req_paths: Vec = vec![]; // Find out if there is already cached dependencies // If so, skip them + let mut in_cache = vec![]; for req in requirements { // Ignore python version annotation backed into lockfile if req.starts_with('#') { @@ -1451,12 +1452,13 @@ pub async fn handle_python_reqs( if metadata(&venv_p).await.is_ok() { // If dir exists skip installation and push path to output req_paths.push(venv_p); + in_cache.push(req.to_string()); } else { req_with_penv.push((req.to_string(), venv_p)); } } - if req_paths.len() > 0 { - append_logs(&job_id, w_id, format!("\nenv deps from local cache: {}\n", req_paths.join(", ")), db).await; + if in_cache.len() > 0 { + append_logs(&job_id, w_id, format!("\nenv deps from local cache: {}\n", in_cache.join(", ")), db).await; } let (kill_tx, ..) = tokio::sync::broadcast::channel::<()>(1); @@ -1777,7 +1779,7 @@ pub async fn handle_python_reqs( &job_id, w_id, format!( - "\nEnv set in {}ms\n", + "\nenv set in {}ms", total_time ), db,