From fb7a93096e0d2ad5d7e983858b504e2e9dc24724 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Sat, 11 Jun 2022 01:28:57 -0300 Subject: [PATCH] only count checked unreachable --- scripts/dht_crawler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/dht_crawler.py b/scripts/dht_crawler.py index 1b55d486e..b2d2fe182 100644 --- a/scripts/dht_crawler.py +++ b/scripts/dht_crawler.py @@ -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):