From 1fad1473c5f1309d1fbe506fdc1c52f5a8fb5b67 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Mon, 10 Feb 2025 07:28:34 -0800 Subject: [PATCH] Check if token changed every 3 seconds instead --- magic-nix-cache/src/flakehub.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/magic-nix-cache/src/flakehub.rs b/magic-nix-cache/src/flakehub.rs index d39f2de..3b5f7e1 100644 --- a/magic-nix-cache/src/flakehub.rs +++ b/magic-nix-cache/src/flakehub.rs @@ -428,10 +428,10 @@ async fn refresh_determinate_token_worker( // NOTE(cole-h): This is a workaround -- at the time of writing, determinate-nixd handles the // GitHub Actions JWT refreshing for us, which means we don't know when this will happen. At the // moment, it does it roughly every 2 minutes (less than half of the total lifetime of the - // issued token), so refreshing every 30 seconds is "fine". + // issued token). loop { - tokio::time::sleep(std::time::Duration::from_secs(30)).await; + tokio::time::sleep(std::time::Duration::from_secs(3)).await; let meta = tokio::fs::metadata(&netrc_file) .await