From 7d9bdb821cfd458c0344b44991188be25d43a140 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 2 Jul 2023 21:19:58 +0200 Subject: [PATCH] Continued: - log response.content when used - variable blocker or block["blocker"] ? The later one. --- fba/commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fba/commands.py b/fba/commands.py index e8d0f72..73814f3 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -880,8 +880,8 @@ def fetch_oliphant(args: argparse.Namespace) -> int: 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"))) - logger.debug("response.ok='%s',response.status_code=%d,response.text()=%d", response.ok, response.status_code, len(response.text)) - if not response.ok or response.status_code > 399 or response.content == "": + logger.debug("response.ok='%s',response.status_code=%d,response.content()=%d", response.ok, response.status_code, len(response.content)) + if not response.ok or response.status_code >= 300 or response.content == "": logger.warning("Could not fetch csv_url='%s' for blocker='%s' - SKIPPED!", block["csv_url"], block["blocker"]) continue @@ -955,7 +955,7 @@ def fetch_oliphant(args: argparse.Namespace) -> int: instances.set_total_blocks(block["blocker"], cnt) logger.debug("Checking if blocker='%s' has pending updates ...", block["blocker"]) - if instances.has_pending(blocker): + if instances.has_pending(block["blocker"]): logger.debug("Flushing updates for block[blocker]='%s' ...", block["blocker"]) instances.update_data(block["blocker"]) -- 2.39.5