Skip to content

Commit

Permalink
add try/catch to not die on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed May 11, 2023
1 parent fe93cce commit 3d3e8d1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
### Upcoming
- UX improvements to `pio run pump_calibration`
- `monitor` is more robust, so as to give users better access to information instead of hard-failing.
- `monitor` now checks for access to web service
- `monitor` now checks the voltage on the PWM rail and will alert if falls to much. If not using the an AUX power supply, this is directly tied to the RPi's power supply.
- `monitor` also publishes the read voltage as a published setting. This is available in the /pioreactor card under System in the UI.
- sqlite3worker is now vendored in the core app. This means we can publish on PyPI.
- improved `systemctl` start up.


### 23.4.28
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 @@ -114,12 +114,17 @@ def pretty_version(info: tuple) -> str:

self.button_down = False
# set up GPIO for accessing the button and changing the LED
self._setup_GPIO()

try:
# if these fail, don't kill the entire job - sucks for onboarding.
self._setup_GPIO()
self.self_checks()
except Exception as e:
self.logger.debug(e, exc_info=True)

# set up a self check function to periodically check vitals and log them
# we manually run a self_check outside of a thread first, as if there are
# problems detected, we may want to block and not let the job continue.
self.self_checks()
self.self_check_thread = RepeatedTimer(
4 * 60 * 60,
self.self_checks,
Expand Down

0 comments on commit 3d3e8d1

Please sign in to comment.