From e2798ef7a3e2ba0c2c166252b353d22a6fa71f82 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 26 Apr 2024 13:40:44 +0200 Subject: [PATCH] rm go bin if cloud hosted --- backend/windmill-worker/src/go_executor.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/windmill-worker/src/go_executor.rs b/backend/windmill-worker/src/go_executor.rs index e350ebafcd..53562107af 100644 --- a/backend/windmill-worker/src/go_executor.rs +++ b/backend/windmill-worker/src/go_executor.rs @@ -394,6 +394,13 @@ func Run(req Req) (interface{{}}, error){{ false, ) .await?; + + if cache && *CLOUD_HOSTED { + //do not keep the binary in the cache if it is cloud hosted to avoid filling up the disk + if let Err(e) = tokio::fs::remove_file(&bin_path).await { + tracing::error!("could not remove {bin_path} from go cache: {e:?}"); + } + } read_result(job_dir).await }