Skip to content

Commit

Permalink
keep checking for mqtt job
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Dec 30, 2024
1 parent 2fb4530 commit ba90b31
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ repos:
hooks:
- id: mypy
additional_dependencies: [
msgspec==0.18.5,
msgspec==0.19.0,
types-pkg_resources==0.1.3,
]

Expand Down
4 changes: 2 additions & 2 deletions config.dev.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
9 changes: 7 additions & 2 deletions pioreactor/background_jobs/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit ba90b31

Please sign in to comment.