Skip to content

Commit

Permalink
💄 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeyk committed Nov 14, 2018
1 parent ee6d9a9 commit 53918d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion belogging/filters.py
Expand Up @@ -54,8 +54,8 @@ def __init__(self, *args, **kwargs):
self._cache = OrderedDict({})

def filter(self, record):
msg = record.getMessage()
with self.lock:
msg = record.getMessage()
if msg in self._cache:
now = datetime.utcnow()
delta = now - self._cache[msg]['time']
Expand All @@ -75,4 +75,5 @@ def filter(self, record):

with self.lock:
self._cache[msg] = {'time': datetime.utcnow(), 'hits': 0}

return True

0 comments on commit 53918d6

Please sign in to comment.