only count checked unreachable

This commit is contained in:
Victor Shyba 2022-06-11 01:28:57 -03:00 committed by Victor Shyba
parent 7ea88e7b31
commit fb7a93096e

View file

@ -81,7 +81,8 @@ class Crawler:
@property
def unreachable_peers_count(self):
return self.recent_peers_query.filter(DHTPeer.latency == None).count()
half_hour_ago = datetime.datetime.utcnow() - datetime.timedelta(minutes=30)
return self.recent_peers_query.filter(DHTPeer.latency == None, DHTPeer.last_check > half_hour_ago).count()
@property
def peers_with_errors_count(self):