Skip to content

Commit

Permalink
monitor will try to reconnect manually. If the client never connects …
Browse files Browse the repository at this point in the history
…originally it won't try to reconnect
  • Loading branch information
CamDavidsonPilon committed Aug 29, 2023
1 parent 4c2d75c commit a61b45a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pioreactor/actions/self_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_all_positive_correlations_between_pds_and_leds(

for ir_pd_channel in pd_channels_to_test:
assert (
results[(ir_led_channel, ir_pd_channel)] > 0.925
results[(ir_led_channel, ir_pd_channel)] > 0.9
), f"missing {ir_led_channel}{ir_pd_channel}"


Expand Down
9 changes: 9 additions & 0 deletions pioreactor/background_jobs/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,15 @@ def check_for_mqtt_connection_to_leader(self) -> None:
self.set_state(self.LOST)
self.flicker_led_with_error_code(error_codes.MQTT_CLIENT_NOT_CONNECTED_TO_LEADER)

try:
self.pub_client.reconnect()
except Exception:
pass
try:
self.sub_client.reconnect()
except Exception:
pass

def check_for_last_backup(self) -> None:
with utils.local_persistant_storage("database_backups") as cache:
if cache.get("latest_backup_timestamp"):
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ sh==1.14.2
JSON-log-formatter==0.4.0
rpi_hardware_pwm==0.1.3
colorlog==6.6.0
msgspec==0.18.0
msgspec==0.18.1
diskcache==5.6.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"sh==1.14.3",
"JSON-log-formatter==0.5.1",
"colorlog==6.7.0",
"msgspec==0.18.0",
"msgspec==0.18.1",
"diskcache==5.6.1",
"wheel==0.38.4",
"crudini==0.9.4",
Expand Down
9 changes: 0 additions & 9 deletions update_scripts/32.7.31/update.sh

This file was deleted.

0 comments on commit a61b45a

Please sign in to comment.