From 24ab670e6eeb3d8b54763fe2109a03e4c079dbf1 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 20 Nov 2023 00:39:40 +0100 Subject: [PATCH] fix: token expiry is equal to timeout --- backend/windmill-worker/src/worker.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/windmill-worker/src/worker.rs b/backend/windmill-worker/src/worker.rs index e03e30579c..3a22349237 100644 --- a/backend/windmill-worker/src/worker.rs +++ b/backend/windmill-worker/src/worker.rs @@ -128,7 +128,7 @@ pub async fn create_token_for_owner( w_id: &str, owner: &str, label: &str, - expires_in: i32, + expires_in: u64, email: &str, ) -> error::Result { // TODO: Bad implementation. We should not have access to this DB here. @@ -273,10 +273,10 @@ lazy_static::lazy_static! { pub static ref TIMEOUT_DURATION: Duration = Duration::from_secs(*TIMEOUT); - pub static ref SCRIPT_TOKEN_EXPIRY: i32 = std::env::var("SCRIPT_TOKEN_EXPIRY") + pub static ref SCRIPT_TOKEN_EXPIRY: u64 = std::env::var("SCRIPT_TOKEN_EXPIRY") .ok() - .and_then(|x| x.parse::().ok()) - .unwrap_or(900); + .and_then(|x| x.parse::().ok()) + .unwrap_or(*TIMEOUT); pub static ref GLOBAL_CACHE_INTERVAL: u64 = std::env::var("GLOBAL_CACHE_INTERVAL") .ok()