X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libs%2Fweb%2Fluasrc%2Fconfig.lua;h=53db82b322d58c4b4b3abb8817d579c89331c1cf;hb=bf49f78599a006a9d136d9fd83cecc5d8a5afb1a;hp=955ede9adbebd2c69483895fc9b202c085bc638a;hpb=91ba7c42f5b45614c9f4c803d09399f08a8e27b1;p=oweals%2Fluci.git diff --git a/libs/web/luasrc/config.lua b/libs/web/luasrc/config.lua index 955ede9ad..53db82b32 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")}) - end - end) \ No newline at end of file + function(m) + if pcall(require, "luci.model.uci") then + 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)