Fix jobs being ignored when downloading plugins in first_start

This commit is contained in:
Théophile Diot 2024-03-14 17:04:40 +00:00
parent 924e885f93
commit 01919d3ce6
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -351,7 +351,6 @@ if __name__ == "__main__":
db.get_plugins(_type=_type, with_data=True),
original_path=EXTERNAL_PLUGINS_PATH if _type == "external" else PRO_PLUGINS_PATH,
)
SCHEDULER.update_jobs()
check_plugin_changes("external")
check_plugin_changes("pro")
@ -367,6 +366,11 @@ if __name__ == "__main__":
changes = db.check_changes()
if INTEGRATION not in ("Swarm", "Kubernetes", "Autoconf") and (changes["pro_plugins_changed"] or changes["external_plugins_changed"]):
if changes["pro_plugins_changed"]:
generate_external_plugins(db.get_plugins(_type="pro", with_data=True), original_path=PRO_PLUGINS_PATH)
if changes["external_plugins_changed"]:
generate_external_plugins(db.get_plugins(_type="external", with_data=True))
# run the config saver to save potential ignored external plugins settings
logger.info("Running config saver to save potential ignored external plugins settings ...")
proc = subprocess_run(
@ -385,6 +389,10 @@ if __name__ == "__main__":
"Config saver failed, configuration will not work as expected...",
)
SCHEDULER.update_jobs()
env = db.get_config()
env["DATABASE_URI"] = db.database_uri
logger.info("Executing scheduler ...")
del dotenv_env