Mercurial > templog
comparison py/fridge.py @ 531:fd0fd9f947a1
improve exception handling
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 11 Apr 2015 21:09:13 +0800 |
parents | dd8895652485 |
children | 19569cb5ed46 |
comparison
equal
deleted
inserted
replaced
530:73257bae83ea | 531:fd0fd9f947a1 |
---|---|
34 def run(self): | 34 def run(self): |
35 if self.server.params.disabled: | 35 if self.server.params.disabled: |
36 L("Fridge is disabled") | 36 L("Fridge is disabled") |
37 while True: | 37 while True: |
38 self.do() | 38 self.do() |
39 yield from self.server.sleep(config.FRIDGE_SLEEP) | 39 try: |
40 yield from self.server.sleep(config.FRIDGE_SLEEP) | |
41 except Exception as e: | |
42 EX("fridge failed") | |
40 | 43 |
41 def do(self): | 44 def do(self): |
42 """ this is the main fridge control logic """ | 45 """ this is the main fridge control logic """ |
43 wort, fridge = self.server.current_temps() | 46 wort, fridge = self.server.current_temps() |
44 | 47 |