From 103846d42a2f699b31e9752f9600c976ad233ccd Mon Sep 17 00:00:00 2001 From: James Muscat Date: Thu, 2 Jul 2015 15:31:04 +0100 Subject: [PATCH] Don't share state between StatsCollector instances! Fixes #30. --- src/eddn/core/StatsCollector.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/eddn/core/StatsCollector.py b/src/eddn/core/StatsCollector.py index fdf8ed7..ab22f68 100644 --- a/src/eddn/core/StatsCollector.py +++ b/src/eddn/core/StatsCollector.py @@ -13,18 +13,17 @@ class StatsCollector(Thread): you choose, up to one hour. ''' - max_minutes = 60 - - current = {} - history = {} - - lock = Lock() - - starttime = 0 - def __init__(self): super(StatsCollector, self).__init__() self.daemon = True + self.max_minutes = 60 + + self.current = {} + self.history = {} + + self.lock = Lock() + + self.starttime = 0 def run(self): self.starttime = datetime.utcnow()