projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5bbc50
)
Reload luci.config for each thread
author
Steven Barth
<steven@midlink.org>
Fri, 5 Dec 2008 15:37:39 +0000
(15:37 +0000)
committer
Steven Barth
<steven@midlink.org>
Fri, 5 Dec 2008 15:37:39 +0000
(15:37 +0000)
libs/web/luasrc/config.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/config.lua
b/libs/web/luasrc/config.lua
index 258f5e655faa3f08986313a87954d02756854164..53db82b322d58c4b4b3abb8817d579c89331c1cf 100644
(file)
--- 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)