From ba90b31fc77385df592f8e53e9f7d7b329a3386c Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Mon, 30 Dec 2024 16:17:29 -0500 Subject: [PATCH] keep checking for mqtt job --- .pre-commit-config.yaml | 2 +- config.dev.ini | 4 ++-- pioreactor/background_jobs/monitor.py | 9 +++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fd43404c..9dc8bfdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: hooks: - id: mypy additional_dependencies: [ - msgspec==0.18.5, + msgspec==0.19.0, types-pkg_resources==0.1.3, ] diff --git a/config.dev.ini b/config.dev.ini index 5b5844f0..eb0d8b9d 100644 --- a/config.dev.ini +++ b/config.dev.ini @@ -68,8 +68,8 @@ smoothing_penalizer=700.0 [storage] database=.pioreactor/storage/pioreactor.sqlite -temporary_cache=/tmp/local_intermittent_pioreactor_metadata.sqlite -persistent_cache=.pioreactor/storage/local_persistent_pioreactor_metadata.db +temporary_cache=/tmp/pioreactor_cache/local_intermittent_pioreactor_metadata.sqlite +persistent_cache=.pioreactor/storage/local_persistent_pioreactor_metadata.sqlite [logging] diff --git a/pioreactor/background_jobs/monitor.py b/pioreactor/background_jobs/monitor.py index 26ff2516..f5ca6cac 100644 --- a/pioreactor/background_jobs/monitor.py +++ b/pioreactor/background_jobs/monitor.py @@ -311,8 +311,13 @@ def check_for_webserver(self) -> None: self.logger.debug(f"Pioreactor UI version: {self.versions['ui']}") def check_for_required_jobs_running(self) -> None: - if not utils.is_pio_job_running("mqtt_to_db_streaming"): - self.logger.warning("mqtt_to_db_streaming should be running on leader. Double check.") + # we put this in a while loop since if mqtt_to_db_streaming is not working, the warning is not saved to disk, + # and the user may never a notification every N hours. So we just spam the user. + while not utils.is_pio_job_running("mqtt_to_db_streaming"): + self.logger.warning( + "mqtt_to_db_streaming should be running on leader. Check `sudo systemctl status pioreactor_startup_run@mqtt_to_db_streaming.service`, or try restarting." + ) + sleep(30) def check_for_HAT(self) -> None: if not is_HAT_present():