diff --git a/gha-cache/src/api.rs b/gha-cache/src/api.rs index 31e1508..a3b3a6f 100644 --- a/gha-cache/src/api.rs +++ b/gha-cache/src/api.rs @@ -334,7 +334,7 @@ impl Api { where S: AsyncRead + Unpin + Send, { - if self.circuit_breaker_429_tripped.load(Ordering::Relaxed) { + if self.circuit_breaker_tripped() { return Err(Error::CircuitBreakerTripped); } @@ -422,7 +422,7 @@ impl Api { /// Downloads a file based on a list of key prefixes. pub async fn get_file_url(&self, keys: &[&str]) -> Result> { - if self.circuit_breaker_429_tripped.load(Ordering::Relaxed) { + if self.circuit_breaker_tripped() { return Err(Error::CircuitBreakerTripped); } @@ -444,7 +444,7 @@ impl Api { /// Retrieves a cache based on a list of key prefixes. async fn get_cache_entry(&self, keys: &[&str]) -> Result> { - if self.circuit_breaker_429_tripped.load(Ordering::Relaxed) { + if self.circuit_breaker_tripped() { return Err(Error::CircuitBreakerTripped); } @@ -478,7 +478,7 @@ impl Api { cache_size: Option, ) -> Result { - if self.circuit_breaker_429_tripped.load(Ordering::Relaxed) { + if self.circuit_breaker_tripped() { return Err(Error::CircuitBreakerTripped); } @@ -508,7 +508,7 @@ impl Api { /// Finalizes uploading to a cache. async fn commit_cache(&self, cache_id: CacheId, size: usize) -> Result<()> { - if self.circuit_breaker_429_tripped.load(Ordering::Relaxed) { + if self.circuit_breaker_tripped() { return Err(Error::CircuitBreakerTripped); }