Update the way the scheduler set his healthy state

This commit is contained in:
Théophile Diot 2024-03-07 18:08:13 +00:00
parent b82642faf7
commit 7e3683ef46
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -30,6 +30,7 @@ from logger import setup_logger # type: ignore
from Database import Database # type: ignore
from JobScheduler import JobScheduler
HEALTHY = False
RUN = True
SCHEDULER: Optional[JobScheduler] = None
INTEGRATION = "Linux"
@ -518,7 +519,6 @@ if __name__ == "__main__":
# infinite schedule for the jobs
logger.info("Executing job scheduler ...")
Path(sep, "var", "tmp", "bunkerweb", "scheduler.healthy").write_text("ok", encoding="utf-8")
while RUN and not NEED_RELOAD:
SCHEDULER.run_pending()
sleep(1)
@ -587,6 +587,10 @@ if __name__ == "__main__":
CONFIG_NEED_GENERATION = True
NEED_RELOAD = True
if not NEED_RELOAD and not HEALTHY:
Path(sep, "var", "tmp", "bunkerweb", "scheduler.healthy").write_text("ok", encoding="utf-8")
HEALTHY = True
FIRST_RUN = False
if NEED_RELOAD: