From 203f19381a696311d603b52cec8c32180b1b7ac9 Mon Sep 17 00:00:00 2001 From: spla Date: Mon, 6 Sep 2021 21:41:04 +0200 Subject: [PATCH] If server is not alive update first_checked_at column to now() --- fediverse.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fediverse.py b/fediverse.py index 50cdb48..2933927 100644 --- a/fediverse.py +++ b/fediverse.py @@ -40,11 +40,11 @@ def is_json(myjson): return True def get_alive_servers(server): - + serv_api = '' serv_soft = '' soft_version = '' - + try: conn = None @@ -296,7 +296,7 @@ def get_alive_servers(server): if first_checked_at != None: - cur.execute("UPDATE fediverse SET updated_at=(%s), alive=(%s), first_checked_at=(%s), downs=(%s) where server=(%s)", (now, alive, NULL, downs, server)) + cur.execute("UPDATE fediverse SET updated_at=(%s), alive=(%s), first_checked_at=(%s), downs=(%s) where server=(%s)", (now, alive, now, downs, server)) else: