From 54c6aed31cc1f344a345f19f9aa583cb55c1b944 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Wed, 5 Jul 2023 00:43:17 +0200 Subject: [PATCH] fix: fix go and python cache resolution conflict --- backend/windmill-worker/src/go_executor.rs | 1 + backend/windmill-worker/src/python_executor.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/windmill-worker/src/go_executor.rs b/backend/windmill-worker/src/go_executor.rs index 11b2479f0c..a35bc187f9 100644 --- a/backend/windmill-worker/src/go_executor.rs +++ b/backend/windmill-worker/src/go_executor.rs @@ -293,6 +293,7 @@ pub async fn install_go_dependencies( } else { "".to_string() }; + let hash = format!("go-{}", hash); let mut skip_tidy = has_sum; diff --git a/backend/windmill-worker/src/python_executor.rs b/backend/windmill-worker/src/python_executor.rs index 1f0937f951..dc751913fd 100644 --- a/backend/windmill-worker/src/python_executor.rs +++ b/backend/windmill-worker/src/python_executor.rs @@ -95,7 +95,7 @@ pub async fn pip_compile( } else { requirements.to_string() }; - let req_hash = calculate_hash(&requirements); + let req_hash = format!("go-{}", calculate_hash(&requirements)); if let Some(cached) = sqlx::query_scalar!( "SELECT lockfile FROM pip_resolution_cache WHERE hash = $1", req_hash @@ -103,7 +103,7 @@ pub async fn pip_compile( .fetch_optional(db) .await? { - logs.push_str(&format!("\nfound cached resolution")); + logs.push_str(&format!("\nfound cached resolution:\n{cached}")); return Ok(cached); } let file = "requirements.in";