mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-16 07:12:05 +03:00
...except that tally should require the lock.
This commit is contained in:
parent
4bab5e3606
commit
384a4f40fe
@ -51,10 +51,11 @@ class StatsCollector(Thread):
|
|||||||
self.outboundMessages += 1
|
self.outboundMessages += 1
|
||||||
|
|
||||||
def tally(self, key):
|
def tally(self, key):
|
||||||
if key not in self.current:
|
with self.lock:
|
||||||
self.current[key] = 1
|
if key not in self.current:
|
||||||
else:
|
self.current[key] = 1
|
||||||
self.current[key] += 1
|
else:
|
||||||
|
self.current[key] += 1
|
||||||
|
|
||||||
def getInboundCount(self, minutes):
|
def getInboundCount(self, minutes):
|
||||||
return sum(islice(self.inboundHistory, 0, min(minutes, self.max_minutes)))
|
return sum(islice(self.inboundHistory, 0, min(minutes, self.max_minutes)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user