comparison py/uploader.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 4d82099d1fe0
children d9e81a563923 28eb733cb803
comparison
equal deleted inserted replaced
218:11631a7f4cf2 219:16a83e2c97a0
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()