From: Roland Häder Date: Mon, 29 Jul 2024 20:25:58 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=65c29a1fa216d5b4d80cd9f66ac1ca7dc8e7bdf0;p=fba.git Continued: - update instance when error has happened (ops, missed this) - also output warning when fields list is empty --- diff --git a/fba/commands.py b/fba/commands.py index 45bfbd7..8715061 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -1075,6 +1075,7 @@ ORDER BY total_peers DESC, last_response_time ASC, last_updated ASC" except network.exceptions as exception: logger.warning("Exception '%s' during fetching instances (fetch_instances) from domain='%s'", type(exception), domain) instances.set_last_error(domain, exception) + instances.update(domain) logger.debug("Success - EXIT!") return 0 diff --git a/fba/models/instances.py b/fba/models/instances.py index 788f403..ff3c0fc 100644 --- a/fba/models/instances.py +++ b/fba/models/instances.py @@ -140,7 +140,7 @@ def update(domain: str): sql_string += f" {key} = ?," logger.debug("sql_string(%d)='%s'", len(sql_string), sql_string) - if sql_string == "": + if sql_string == "" or len(fields) == 0: raise ValueError(f"No fields have been set, but function invoked, domain='{domain}'") # Set last_updated to current timestamp