diff --git a/app/lib/katello/resources/candlepin/candlepin_ping.rb b/app/lib/katello/resources/candlepin/candlepin_ping.rb index 846ca08ec6f..0e27d3b2a44 100644 --- a/app/lib/katello/resources/candlepin/candlepin_ping.rb +++ b/app/lib/katello/resources/candlepin/candlepin_ping.rb @@ -8,10 +8,15 @@ class CandlepinPing < CandlepinResource class << self def ping(try_cache: false) - Rails.cache.fetch(CACHE_KEY, expires_in: CACHE_TTL, race_condition_ttl: RACE_TTL, force: !try_cache) do + cache_miss = false + result = Rails.cache.fetch(CACHE_KEY, expires_in: CACHE_TTL, race_condition_ttl: RACE_TTL, force: !try_cache) do + cache_miss = true + ::Foreman::Logging.logger('registration').debug "rhsm_status cache=MISS" response = get('/candlepin/status').body JSON.parse(response).with_indifferent_access end + ::Foreman::Logging.logger('registration').debug "rhsm_status cache=HIT" unless cache_miss || !try_cache + result end def ok?