From bf47c1dac1b158f17fc80f03f5dd8cb878d8d903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Mon, 27 Jan 2025 15:55:43 +0100 Subject: [PATCH] Add conditional logging for send failures based on IGNORE_FAIL_SENDING_CONFIG --- src/scheduler/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scheduler/main.py b/src/scheduler/main.py index 2c0edbc85..f781c31f7 100644 --- a/src/scheduler/main.py +++ b/src/scheduler/main.py @@ -197,12 +197,12 @@ def send_file_to_bunkerweb(file_path: Path, endpoint: str): LOGGER.debug(f"Removing {db_instance['hostname']}:{db_instance['port']} from the list of reachable instances") del SCHEDULER.apis[index] - LOGGER.warning(f"Error while sending {file_path} to some BunkerWeb instances, removing them from the list of reachable instances: {', '.join(fails)}") - if not success: LOGGER.error(f"Error while sending {file_path} to BunkerWeb instances") elif not fails: LOGGER.info(f"Successfully sent {file_path} folder to reachable BunkerWeb instances") + elif not IGNORE_FAIL_SENDING_CONFIG: + LOGGER.warning(f"Error while sending {file_path} to some BunkerWeb instances, removing them from the list of reachable instances: {', '.join(fails)}") def generate_custom_configs(configs: Optional[List[Dict[str, Any]]] = None, *, original_path: Union[Path, str] = CUSTOM_CONFIGS_PATH):