one tasks queue instead of one per websocket

This commit is contained in:
j 2014-05-26 13:21:19 +02:00
commit 5b33721c87
6 changed files with 71 additions and 51 deletions

View file

@ -241,7 +241,7 @@ actions.register(cancelDownloads, cache=False)
def scan(data):
state.main.add_callback(state.websockets[0].put, json.dumps(['scan', {}]))
state.tasks.queue('scan', {})
return {}
actions.register(scan, cache=False)
@ -255,7 +255,7 @@ def _import(data):
}
'''
logger.debug('api.import %s', data)
state.main.add_callback(state.websockets[0].put, json.dumps(['import', data]))
state.tasks.queue('import', data)
return {}
actions.register(_import, 'import', cache=False)