From e99937fb194ee343d163c5c6c364e5d9d36c710a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Diot?= Date: Wed, 22 May 2024 12:40:17 +0100 Subject: [PATCH] chore: Ignore plugins with not changed checksum during generation in scheduler --- src/scheduler/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scheduler/main.py b/src/scheduler/main.py index ed098317e..0aa13627a 100644 --- a/src/scheduler/main.py +++ b/src/scheduler/main.py @@ -174,6 +174,7 @@ def generate_external_plugins(plugins: List[Dict[str, Any]], *, original_path: U # Remove old external/pro plugins files logger.info(f"Removing old/changed {'pro ' if pro else ''}external plugins files ...") + ignored_plugins = set() if original_path.is_dir(): for file in original_path.glob("*"): try: @@ -187,6 +188,7 @@ def generate_external_plugins(plugins: List[Dict[str, Any]], *, original_path: U tar.add(file, arcname=file.name, recursive=True) plugin_content.seek(0, 0) if bytes_hash(plugin_content, algorithm="sha256") == plugins[index]["checksum"]: + ignored_plugins.add(file.name) continue logger.debug(f"Checksum of {file} has changed, removing it ...") @@ -200,6 +202,9 @@ def generate_external_plugins(plugins: List[Dict[str, Any]], *, original_path: U logger.info(f"Generating new {'pro ' if pro else ''}external plugins ...") original_path.mkdir(parents=True, exist_ok=True) for plugin in plugins: + if plugin["id"] in ignored_plugins: + continue + try: if plugin["data"]: tmp_path = TMP_PATH.joinpath(f"{plugin['id']}_{plugin['name']}.tar.gz")