Mercurial > templog
comparison py/uploader.py @ 518:0b5ff341d124
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 | 56cdea43b366 |
children | d9e81a563923 28eb733cb803 |
comparison
equal
deleted
inserted
replaced
517:c399293de160 | 518:0b5ff341d124 |
---|---|
21 | 21 |
22 def _run(self): | 22 def _run(self): |
23 gevent.sleep(5) | 23 gevent.sleep(5) |
24 while True: | 24 while True: |
25 self.do() | 25 self.do() |
26 gevent.sleep(config.UPLOAD_SLEEP) | 26 self.server.sleep(config.UPLOAD_SLEEP) |
27 | 27 |
28 def get_tosend(self, readings): | 28 def get_tosend(self, readings): |
29 tosend = {} | 29 tosend = {} |
30 | 30 |
31 tosend['fridge_on'] = self.server.fridge.is_on() | 31 tosend['fridge_on'] = self.server.fridge.is_on() |