diff --git a/src/rust/engine/process_execution/src/remote.rs b/src/rust/engine/process_execution/src/remote.rs index 1a8ad16acbb..02e98b83a5e 100644 --- a/src/rust/engine/process_execution/src/remote.rs +++ b/src/rust/engine/process_execution/src/remote.rs @@ -1283,7 +1283,12 @@ pub async fn check_action_cache( .increment_counter(Metric::RemoteCacheRequestsUncached, 1); Ok(None) } - _ => Err(rpcerror_to_string(err)), + _ => { + context + .workunit_store + .increment_counter(Metric::RemoteCacheReadErrors, 1); + Err(rpcerror_to_string(err)) + } }, } } diff --git a/src/rust/engine/process_execution/src/remote_cache.rs b/src/rust/engine/process_execution/src/remote_cache.rs index ef3817fa862..625c69d8bea 100644 --- a/src/rust/engine/process_execution/src/remote_cache.rs +++ b/src/rust/engine/process_execution/src/remote_cache.rs @@ -440,9 +440,6 @@ impl crate::CommandRunner for CommandRunner { } Err(err) => { log::warn!("Failed to read from remote cache: {}", err); - context - .workunit_store - .increment_counter(Metric::RemoteCacheReadErrors, 1); } }; }