mod_pastebin/mod_pastebin.lua
changeset 517 f866325305ed
parent 516 3d3687fef751
child 565 9c2eea631811
--- a/mod_pastebin/mod_pastebin.lua	Wed Dec 21 10:25:17 2011 +0000
+++ b/mod_pastebin/mod_pastebin.lua	Wed Dec 21 10:38:44 2011 +0000
@@ -143,7 +143,7 @@
 	httpserver.new{ port = port, base = base, handler = handle_request, ssl = ssl }
 end
 
-function module.load()
+local function set_pastes_metatable()
 	if expire_after == 0 then
 		local dm = require "util.datamanager";
 		setmetatable(pastes, {
@@ -163,10 +163,13 @@
 	end
 end
 
+module.load = set_pastes_metatable;
+
 function module.save()
 	return { pastes = pastes };
 end
 
 function module.restore(data)
 	pastes = data.pastes or pastes;
+	set_pastes_metatable();
 end