Skip to content
Snippets Groups Projects
Commit 9475a4b4 authored by Jan Mach's avatar Jan Mach
Browse files

Fix: Fixed issues with incorrect use or in-memory thresholding cache.

parent 021eedad
No related branches found
No related tags found
No related merge requests found
......@@ -501,7 +501,12 @@ class SimpleMemoryThresholdingCache(ThresholdingCache):
"""
*Interface implementation:* Implementation of :py:func:`mentat.reports.utils.ThresholdingCache.cleanup` method.
"""
return {'thresholds': 0, 'events': 0}
result = {
'thresholds': len(self.memcache),
'events': 0
}
self.memcache = {}
return result
class SingleSourceThresholdingCache(SimpleMemoryThresholdingCache):
......
......@@ -285,7 +285,7 @@ def evaluate_timeline_events(events, dt_from, dt_to, max_count, stats = None):
for event in events:
# Detect recurring events.
recurring = tcache.event_is_thresholded(event, None)
recurring = tcache.event_is_thresholded(event, None, None)
tcache.set_threshold(event, None, None, None, None)
# Include event into global statistics.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment