reload on GET /rpc/refresh

This commit is contained in:
boyska 2016-09-13 00:42:21 +02:00
parent a2e5e71510
commit ac0f0d9469
No known key found for this signature in database
GPG key ID: 7395DCAE58289CA9
3 changed files with 6 additions and 2 deletions

View file

@ -46,3 +46,5 @@ This is useful if you want to debug the event system, or if you manually
changed the data on disk. Please note that the event system will automatically
reload the DB from disk when appropriate. However, the WebUI will not, so you
might have a misleading ``/db/list`` page; send an ``ALRM`` in this case.
The same effect can be triggered performing an HTTP ``GET /rpc/refresh``.

View file

@ -134,8 +134,10 @@ class Controller(gevent.Greenlet):
except Exception:
self.log.exception("Error while adding to queue; "
"bad audiogen output?")
elif kind == 'signal' and args[0] == signal.SIGALRM:
elif (kind == 'signal' and args[0] == signal.SIGALRM) or \
kind == 'refresh':
# it's a tick!
self.log.debug("Reload")
self.monitor.q.put(dict(kind='forcetick'))
gevent.Greenlet.spawn(self.player.check_playlist)
else:

View file

@ -38,7 +38,7 @@ def rpc_index():
@rpc.route('/refresh')
def rpc_refresh():
send_to_parent('rpc')
send_to_parent('refresh')
return jsonify(dict(status='ok'))