mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-14 22:32:20 +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
|
||||
|
||||
def tally(self, key):
|
||||
if key not in self.current:
|
||||
self.current[key] = 1
|
||||
else:
|
||||
self.current[key] += 1
|
||||
with self.lock:
|
||||
if key not in self.current:
|
||||
self.current[key] = 1
|
||||
else:
|
||||
self.current[key] += 1
|
||||
|
||||
def getInboundCount(self, minutes):
|
||||
return sum(islice(self.inboundHistory, 0, min(minutes, self.max_minutes)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user