summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-12-05 15:37:39 +0000
committerSteven Barth <steven@midlink.org>2008-12-05 15:37:39 +0000
commit4ef86cacadfed121d2ea07f4580003c33a371bb8 (patch)
treec2139fcd7dba65272a4c7ff036d770882da55892 /libs
parentb5bbc5041f8587c921cc63b60b2e8b24b87e65d5 (diff)
Reload luci.config for each thread
Diffstat (limited to 'libs')
-rw-r--r--libs/web/luasrc/config.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/libs/web/luasrc/config.lua b/libs/web/luasrc/config.lua
index 258f5e655f..53db82b322 100644
--- a/libs/web/luasrc/config.lua
+++ b/libs/web/luasrc/config.lua
@@ -25,9 +25,18 @@ limitations under the License.
]]--
+local util = require "luci.util"
module("luci.config",
function(m)
if pcall(require, "luci.model.uci") then
- setmetatable(m, {__index = luci.model.uci.cursor():get_all("luci")})
+ local config = util.threadlocal()
+ setmetatable(m, {
+ __index = function(tbl, key)
+ if not config[key] then
+ config[key] = luci.model.uci.cursor():get_all("luci", key)
+ end
+ return config[key]
+ end
+ })
end
- end) \ No newline at end of file
+ end)