From 3294a44f769a6b1aa067e6c7a1e5098ccf45341a Mon Sep 17 00:00:00 2001 From: nanos Date: Thu, 3 Aug 2023 15:21:12 +0100 Subject: [PATCH] cache host failures for a shorter time --- find_posts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/find_posts.py b/find_posts.py index ea9b695..d697349 100644 --- a/find_posts.py +++ b/find_posts.py @@ -1373,6 +1373,9 @@ if __name__ == "__main__": serverAge = datetime.now(serverInfo['last_checked'].tzinfo) - serverInfo['last_checked'] if(serverAge.total_seconds() > arguments.remember_hosts_for_days * 24 * 60 * 60 ): seen_hosts.pop(host) + elif('info' in serverInfo and serverInfo['info'] == None and serverAge.total_seconds() > 60 * 60 ): + # Don't cache failures for more than 24 hours + seen_hosts.pop(host) else: seen_hosts = ServerList({})