]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Fri, 2 Jun 2023 11:45:14 +0000 (13:45 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 2 Jun 2023 11:45:14 +0000 (13:45 +0200)
- don't unset last_status_code/last_error_details on any update of instance  data

fba.py

diff --git a/fba.py b/fba.py
index b45a0195c8a0eb606e9aeb3f1910e008a2d943c7..95774e71eaf02083ec9b9be5bd38c2e6bb833e4c 100644 (file)
--- a/fba.py
+++ b/fba.py
@@ -192,7 +192,7 @@ def is_cache_key_set(key: str, sub: str) -> bool:
 
 def is_primitive(var: any) -> bool:
     #print(f"DEBUG: var[]='{type(var)}' - CALLED!")
-    return type(var) in {int, str, float, bool}
+    return type(var) in {int, str, float, bool, NoneType}
 
 def set_instance_data(key: str, domain: str, value: any):
     #print(f"DEBUG: key='{key}',domain='{domain}',value[]='{type(value)}' - CALLED!")
@@ -438,7 +438,7 @@ def update_instance_data(domain: str):
         raise ValueError(f"No fields have been set, but method invoked, domain='{domain}'")
 
     # DEBUG: print(f"DEBUG: sql_string='{sql_string}',fields()={len(fields)}")
-    sql = "UPDATE instances SET" + sql_string + " last_status_code = NULL, last_error_details = NULL, last_updated = TIME() WHERE domain = ? LIMIT 1"
+    sql = "UPDATE instances SET" + sql_string + " last_updated = TIME() WHERE domain = ? LIMIT 1"
     # DEBUG: print("DEBUG: sql:", sql)
 
     try:
@@ -1176,6 +1176,8 @@ def add_instance(domain: str, origin: str, originator: str, path: str = None):
 
         if has_pending_instance_data(domain):
             # DEBUG: print(f"DEBUG: domain='{domain}' has pending nodeinfo being updated ...")
+            set_instance_data("last_status_code"  , domain, None)
+            set_instance_data("last_error_details", domain, None)
             update_instance_data(domain)
             remove_pending_error(domain)