From 1a035d1148619c05ef99a3dd81a82cc6f0c5291d Mon Sep 17 00:00:00 2001 From: Tom Dyas Date: Wed, 11 Nov 2020 18:33:00 -0800 Subject: [PATCH] move counter increment into check_action_cachey [ci skip-build-wheels] --- src/rust/engine/process_execution/src/remote.rs | 7 ++++++- src/rust/engine/process_execution/src/remote_cache.rs | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) 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); } }; }