summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorWojciech Jowsa <wojciech.jowsa@gmail.com>2020-08-19 12:49:03 +0200
committerWojciech Jowsa <wojciech.jowsa@gmail.com>2020-08-19 13:00:49 +0200
commit1f6dc29f745b3a38d7b5cab709964ad78d69de1c (patch)
tree970c7dfd455386505155bf437b6dc57b62ceea59
parentb2fa7903ebfdbe9f485a94710b77320fe7897dba (diff)
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>
-rw-r--r--libs/luci-lib-base/luasrc/util.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/luci-lib-base/luasrc/util.lua b/libs/luci-lib-base/luasrc/util.lua
index 38e00ad83..89757917f 100644
--- a/libs/luci-lib-base/luasrc/util.lua
+++ b/libs/luci-lib-base/luasrc/util.lua
@@ -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