aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/moduleapi.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 54077826..c98a7e4b 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -155,6 +155,9 @@ function api:shared(...)
local shared = shared_data[path];
if not shared then
shared = {};
+ if path:match("%-cache$") then
+ setmetatable(shared, { __mode = "kv" });
+ end
shared_data[path] = shared;
end
t_insert(data_array, shared);
@@ -336,4 +339,4 @@ function api:load_resource(path, mode)
return io.open(path, mode);
end
-return api; \ No newline at end of file
+return api;