]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 10 Dec 2023 23:54:01 +0000 (00:54 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 10 Dec 2023 23:54:01 +0000 (00:54 +0100)
- also check blacklist in instances.is_recent() function
- first check against blacklist, then if it is recent (in commands.py)

fba/commands.py
fba/models/instances.py

index 2e36ee49e53853c08675a5ac4b506634d2eb4a65..8ae57220907e5a9a3fd409b19e30f2a23eff4137 100644 (file)
@@ -1502,12 +1502,12 @@ def update_nodeinfo(args: argparse.Namespace) -> int:
     cnt = 0
     for row in domains:
         logger.debug("row[]='%s'", type(row))
-        if not args.force and instances.is_recent(row["domain"], "last_nodeinfo"):
-            logger.debug("row[domain]='%s' has been recently checked - SKIPPED!", row["domain"])
-            continue
-        elif blacklist.is_blacklisted(row["domain"]):
+        if blacklist.is_blacklisted(row["domain"]):
             logger.debug("row[domain]='%s' is blacklisted - SKIPPED!", row["domain"])
             continue
+        elif not args.force and instances.is_recent(row["domain"], "last_nodeinfo"):
+            logger.debug("row[domain]='%s' has been recently checked - SKIPPED!", row["domain"])
+            continue
 
         try:
             logger.info("Checking nodeinfo for row[domain]='%s',row[software]='%s' (%s%%) ...", row["domain"], row["software"], "{:5.1f}".format(cnt / len(domains) * 100))
index e86128181f8dd487a299d40412f6a4502e9c039b..ab9995f83523b3613d145665077ca80e174c8d0e 100644 (file)
@@ -338,6 +338,8 @@ def is_recent(domain: str, column: str = "last_instance_fetch") -> bool:
         raise ValueError(f"Parameter column[]='{type(column)}' is not of type 'str'")
     elif not column.startswith("last_"):
         raise ValueError(f"Parameter column='{column}' is not expected")
+    elif blacklist.is_blacklisted(domain):
+        raise ValueError(f"domain='{domain}' is blacklisted but function was invoked")
     elif not is_registered(domain):
         logger.debug("domain='%s' is not registered, returning False - EXIT!", domain)
         return False