Mercurial > templog
comparison py/fridge.py @ 232:a01b7bccccd3
improve exception handling
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 11 Apr 2015 21:09:13 +0800 |
parents | d9e81a563923 |
children | 19569cb5ed46 |
comparison
equal
deleted
inserted
replaced
231:e39ed85d87a5 | 232:a01b7bccccd3 |
---|---|
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 |