Support action async call flag

This commit is contained in:
shortcutme 2019-08-26 03:08:57 +02:00
parent ed7a3b2356
commit c414e6caa2
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -228,7 +228,8 @@ class UiWebsocket(object):
return self.response(req["id"], {"error": "You don't have permission to run %s" % cmd})
# Execute in parallel
if cmd in self.async_commands:
func_flags = flag.db.get(self.getCmdFuncName(cmd), ())
if func_flags and "async_run" in func_flags:
func = self.asyncWrapper(func)
# Support calling as named, unnamed parameters and raw first argument too