Mercurial > templog
comparison py/fridge.py @ 219:16a83e2c97a0
sleep on a semaphore so it can start/stop immediately when there's a SIGHUP
from the web UI. makes it seem more magical.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 19 Dec 2014 21:52:50 +0800 |
parents | 3f187baa3439 |
children | 251524081924 |
comparison
equal
deleted
inserted
replaced
218:11631a7f4cf2 | 219:16a83e2c97a0 |
---|---|
50 def _run(self): | 50 def _run(self): |
51 if self.server.params.disabled: | 51 if self.server.params.disabled: |
52 L("Fridge is disabled") | 52 L("Fridge is disabled") |
53 while True: | 53 while True: |
54 self.do() | 54 self.do() |
55 gevent.sleep(config.FRIDGE_SLEEP) | 55 self.server.sleep(config.FRIDGE_SLEEP) |
56 | 56 |
57 def do(self): | 57 def do(self): |
58 """ this is the main fridge control logic """ | 58 """ this is the main fridge control logic """ |
59 wort, fridge = self.server.current_temps() | 59 wort, fridge = self.server.current_temps() |
60 | 60 |