From 580d0fe29faa2da7548616dda3e84191b69b3bfb Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Sun, 24 Sep 2023 19:38:41 +0200 Subject: [PATCH] fix: optimize performance for bun scripts without deps --- backend/windmill-worker/src/bun_executor.rs | 23 +++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/backend/windmill-worker/src/bun_executor.rs b/backend/windmill-worker/src/bun_executor.rs index df9e4721d8..f7c033d357 100644 --- a/backend/windmill-worker/src/bun_executor.rs +++ b/backend/windmill-worker/src/bun_executor.rs @@ -219,18 +219,19 @@ pub async fn handle_bun_job( })?, ) .await?; + + install_lockfile( + logs, + &job.id, + &job.workspace_id, + db, + job_dir, + worker_name, + common_bun_proc_envs.clone(), + ) + .await?; + remove_dir_all(format!("{}/node_modules", job_dir)).await?; } - install_lockfile( - logs, - &job.id, - &job.workspace_id, - db, - job_dir, - worker_name, - common_bun_proc_envs.clone(), - ) - .await?; - remove_dir_all(format!("{}/node_modules", job_dir)).await?; } else if !*DISABLE_NSJAIL { logs.push_str("\n\n--- BUN INSTALL ---\n"); set_logs(&logs, &job.id, &db).await;