Add now the scheduler will pass his own env as well to jobs

This commit is contained in:
Théophile Diot 2023-04-18 15:30:09 +02:00
parent 9578ace026
commit 707256076a
No known key found for this signature in database
GPG Key ID: E752C80DB72BB014
1 changed files with 2 additions and 12 deletions

View File

@ -6,6 +6,7 @@ from glob import glob
from os import (
_exit,
chmod,
environ,
getenv,
getpid,
listdir,
@ -214,13 +215,6 @@ if __name__ == "__main__":
"Kubernetes",
"Autoconf",
):
# err = db.set_autoconf_load(False)
# if err:
# success = False
# logger.error(
# f"Can't set autoconf loaded metadata to false in database: {err}",
# )
while not db.is_autoconf_loaded():
logger.warning(
"Autoconf is not loaded yet in the database, retrying in 5s ...",
@ -327,7 +321,7 @@ if __name__ == "__main__":
while True:
# Instantiate scheduler
scheduler = JobScheduler(
env=deepcopy(env),
env=deepcopy(env) | environ,
apis=api_caller._get_apis(),
logger=logger,
integration=integration,
@ -484,10 +478,6 @@ if __name__ == "__main__":
)
else:
need_reload = True
# if api_caller._send_to_apis("POST", "/reload"):
# logger.info("Successfully reloaded nginx")
# else:
# logger.error("Error while reloading nginx")
# check if the plugins have changed since last time
tmp_external_plugins = db.get_plugins(external=True)