Dont add removed trackers to announcer stats

This commit is contained in:
shortcutme 2018-09-04 15:43:52 +02:00
parent 12d494bf38
commit a5c25ce438
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -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