From d475a4e31eaf049aacacfd3e7de8ae4aa499b7c9 Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 3 Jan 2024 21:22:18 +0100 Subject: [PATCH] scheduler - fix missing custom configs when instances change --- CHANGELOG.md | 1 + src/scheduler/main.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39f6c5657..f0a84260d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - [BUGFIX] Fix issues with the database when upgrading from version 1.5.3 and 1.5.4 to the most recent version - [BUGFIX] Fix ModSecurity-nginx to make it work with brotli - [BUGFIX] Remove certbot renew delay causing errors on k8s +- [BUGFIX] Fix missing custom modsec files when BW instances change - [FEATURE] Add Anonymous reporting feature - [FEATURE] Add support for fallback Referrer-Policies - [FEATURE] Add profile page to web ui and the possibility to activate the 2FA diff --git a/src/scheduler/main.py b/src/scheduler/main.py index 7ac71db41..28f59049f 100644 --- a/src/scheduler/main.py +++ b/src/scheduler/main.py @@ -644,6 +644,7 @@ if __name__ == "__main__": if changes["instances_changed"]: logger.info("Instances changed, generating ...") INSTANCES_NEED_GENERATION = True + CONFIGS_NEED_GENERATION = True CONFIG_NEED_GENERATION = True NEED_RELOAD = True @@ -652,6 +653,10 @@ if __name__ == "__main__": if NEED_RELOAD: CHANGES.clear() + if INSTANCES_NEED_GENERATION: + CHANGES.append("instances") + SCHEDULER.update_instances() + if CONFIGS_NEED_GENERATION: CHANGES.append("custom_configs") generate_custom_configs(db.get_custom_configs(), original_path=configs_path) @@ -669,9 +674,7 @@ if __name__ == "__main__": env = db.get_config() env["DATABASE_URI"] = db.database_uri - if INSTANCES_NEED_GENERATION: - CHANGES.append("instances") - SCHEDULER.update_instances() + except: logger.error( f"Exception while executing scheduler : {format_exc()}",