At start, run a check

fixes #1
This commit is contained in:
boyska 2015-05-12 18:09:37 +02:00
parent be23532cda
commit 423be1333f
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9
2 changed files with 4 additions and 1 deletions

View file

@ -19,6 +19,7 @@ def get_conf(prefix='LARIGIRA_'):
conf['SECRET_KEY'] = 'Please replace me!'
conf['MPD_WAIT_START'] = True
conf['MPD_WAIT_START_RETRYSECS'] = 5
conf['CHECK_SECS'] = 20
conf.update(from_envvars(prefix=prefix))
return conf

View file

@ -68,7 +68,9 @@ class Player(gevent.Greenlet):
def _run(self):
MpcWatcher(self.q, self.conf, client=None).start()
Timer(60 * 1000, self.q).start()
Timer(int(self.conf['CHECK_SECS']) * 1000, self.q).start()
# at the very start, run a check!
gevent.Greenlet.spawn(self.check_playlist)
while True:
value = self.q.get()
self.log.debug('<- %s' % str(value))