Correct cache miss detection
parent
903fb34b39
commit
ff2d7551c7
|
@ -79,7 +79,7 @@ class ExpiringCache(object):
|
||||||
try:
|
try:
|
||||||
entry = self._cache[key]
|
entry = self._cache[key]
|
||||||
cache_counter.inc_hits(self._cache_name)
|
cache_counter.inc_hits(self._cache_name)
|
||||||
finally:
|
except KeyError:
|
||||||
cache_counter.inc_misses(self._cache_name)
|
cache_counter.inc_misses(self._cache_name)
|
||||||
|
|
||||||
if self._reset_expiry_on_get:
|
if self._reset_expiry_on_get:
|
||||||
|
|
Loading…
Reference in New Issue