thegridelectric / gw-scada-spaceheat-python

GridWorks SCADA for space heating
MIT License
5 stars 2 forks source link

Exceptions in MQTT main loop no longer crash scada #158

Closed anschweitzer closed 1 year ago

anschweitzer commented 1 year ago

The mqtt loop is now run explicitly in a thread controlled by the proactor's MQTTClientWrapper, rather than implicitly by calling the client's loop_start() function. If the mqtt loop produces an exception, the scada will generate an activity report than wait an exponentially increasing amount of time (up to ~15 minutes) before trying to run the mqtt loop again.

codecov[bot] commented 1 year ago

Codecov Report

Merging #158 (244d846) into main (92a2f2c) will decrease coverage by 0.08%. The diff coverage is 75.90%.

@@            Coverage Diff             @@
##             main     #158      +/-   ##
==========================================
- Coverage   87.03%   86.95%   -0.09%     
==========================================
  Files         219      219              
  Lines       13191    13240      +49     
==========================================
+ Hits        11481    11513      +32     
- Misses       1710     1727      +17     
Impacted Files Coverage Δ
gw_spaceheat/proactor/watchdog.py 82.41% <ø> (-0.38%) :arrow_down:
tests/atn/atn.py 91.17% <ø> (-0.17%) :arrow_down:
gw_spaceheat/proactor/problems.py 81.81% <33.33%> (-9.49%) :arrow_down:
gw_spaceheat/proactor/mqtt.py 90.32% <71.42%> (-3.47%) :arrow_down:
gw_spaceheat/proactor/proactor_implementation.py 82.85% <84.84%> (-0.18%) :arrow_down:
gw_spaceheat/proactor/message.py 92.30% <90.00%> (-0.29%) :arrow_down:
gw_spaceheat/proactor/sync_thread.py 82.67% <100.00%> (ø)
gw_spaceheat/proactor/link_state.py 94.09% <0.00%> (+0.36%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more