]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 3 Aug 2023 19:33:05 +0000 (21:33 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 3 Aug 2023 19:33:05 +0000 (21:33 +0200)
- update last_blocked timestamp when a blocklist has been fetched/generated for
  an instance aka. "blocker"

fba/commands.py

index bd2dd221279151d6759b05cd786adbf9f3ec1d54..f35c0961571d79551f6291eb6f3aea5c023cade4 100644 (file)
@@ -605,6 +605,7 @@ def fetch_todon_wiki(args: argparse.Namespace) -> int:
     blocker = "todon.eu"
 
     logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", blocker, len(blocking))
+    instances.set_last_blocked(blocker)
     instances.set_total_blocks(blocker, blocking)
 
     blockdict = list()
@@ -713,6 +714,7 @@ def fetch_cs(args: argparse.Namespace):
     blocker = "chaos.social"
 
     logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", blocker, len(blocking))
+    instances.set_last_blocked(blocker)
     instances.set_total_blocks(blocker, blocking)
 
     logger.debug("blocklist[silenced]()=%d,blocklist[reject]()=%d", len(blocklist["silenced"]), len(blocklist["reject"]))
@@ -1041,6 +1043,8 @@ def fetch_oliphant(args: argparse.Namespace) -> int:
             logger.debug("args.domain='%s' already handled - SKIPPED!", args.domain)
             continue
 
+        instances.set_last_blocked(block["blocker"])
+
         # Fetch this URL
         logger.info("Fetching csv_url='%s' for blocker='%s' ...", block["csv_url"], block["blocker"])
         response = utils.fetch_url(f"{base_url}/{block['csv_url']}", network.web_headers, (config.get("connection_timeout"), config.get("read_timeout")))
@@ -1502,6 +1506,7 @@ def fetch_joinfediverse(args: argparse.Namespace) -> int:
     for blocker in domains:
         blocker = blocker[0]
         logger.debug("blocker[%s]='%s'", type(blocker), blocker)
+        instances.set_last_blocked(blocker)
 
         for block in blocking:
             logger.debug("block[blocked]='%s',block[block reason(s)]='%s' - BEFORE!", block["blocked"], block["block reason(s)"] if "block reason(s)" in block else None)
@@ -1582,6 +1587,7 @@ def recheck_obfuscation(args: argparse.Namespace) -> int:
         # chaos.social requires special care ...
         if row["domain"] != "chaos.social":
             logger.debug("Invoking instances.set_total_blocks(%s, %d) ...", row["domain"], len(blocking))
+            instances.set_last_blocked(row["domain"])
             instances.set_total_blocks(row["domain"], blocking)
 
         obfuscated = 0