luci-base: Add possiblity to set path and timeout of ubus connection
It might happen (e.g. when downloading a large file with low speed connection) that the ubus connection will time out. The ubus_connect function allows to specify ubus socket path and ubus connection timeout so it should allowed to set these arguments from luci. Signed-off-by: Wojciech Jowsa <wojciech.jowsa@gmail.com>
This commit is contained in:
parent
b2fa7903eb
commit
1f6dc29f74
1 changed files with 2 additions and 2 deletions
|
@ -663,9 +663,9 @@ local function ubus_return(...)
|
|||
return ...
|
||||
end
|
||||
|
||||
function ubus(object, method, data)
|
||||
function ubus(object, method, data, path, timeout)
|
||||
if not _ubus_connection then
|
||||
_ubus_connection = _ubus.connect()
|
||||
_ubus_connection = _ubus.connect(path, timeout)
|
||||
assert(_ubus_connection, "Unable to establish ubus connection")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue