From b9f89bd546ee188f8a03f16db79f97ae471464ec Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Tue, 14 Jan 2025 13:56:17 -0800 Subject: [PATCH] Suggest FlakeHub Cache when hit by 429 --- gha-cache/src/api.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gha-cache/src/api.rs b/gha-cache/src/api.rs index 1f0b545..52a7a83 100644 --- a/gha-cache/src/api.rs +++ b/gha-cache/src/api.rs @@ -624,10 +624,16 @@ impl AtomicCircuitBreaker for AtomicBool { fn check_err(&self, e: &Error) { if let Error::ApiError { status: reqwest::StatusCode::TOO_MANY_REQUESTS, - info: ref _info, + .. } = e { tracing::info!("Disabling GitHub Actions Cache due to 429: Too Many Requests"); + let msg = "\ + Magic Nix Cache has exceeded GitHub Actions Cache's rate limit. \ + Save more time and seamlessly share the builds across your team with FlakeHub Cache. \ + See: https://flakehub.com/pricing\ + "; + println!("::notice::{msg}"); self.store(true, Ordering::Relaxed); } }