mirror of
https://github.com/HelloZeroNet/ZeroNet.git
synced 2023-12-14 04:33:03 +01:00
Dont add removed trackers to announcer stats
This commit is contained in:
parent
12d494bf38
commit
a5c25ce438
1 changed files with 4 additions and 1 deletions
|
@ -392,11 +392,14 @@ class UiWebsocket(object):
|
|||
|
||||
def actionAnnouncerStats(self, to):
|
||||
back = {}
|
||||
trackers = self.site.announcer.getTrackers()
|
||||
for site in self.server.sites.values():
|
||||
for tracker, stats in site.announcer.stats.iteritems():
|
||||
if tracker not in trackers:
|
||||
continue
|
||||
if tracker not in back:
|
||||
back[tracker] = {}
|
||||
is_latest_data = stats["time_request"] > back[tracker].get("time_request", 0) and stats["status"]
|
||||
is_latest_data = bool(stats["time_request"] > back[tracker].get("time_request", 0) and stats["status"])
|
||||
for key, val in stats.iteritems():
|
||||
if key.startswith("num_"):
|
||||
back[tracker][key] = back[tracker].get(key, 0) + val
|
||||
|
|
Loading…
Reference in a new issue