reload on GET /rpc/refresh
This commit is contained in:
parent
a2e5e71510
commit
ac0f0d9469
3 changed files with 6 additions and 2 deletions
|
@ -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``.
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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'))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue