Changeset

2802:0d5d1ff96600

mod_storage_memory: Serialize stanzas on save (was delayed until query)
author Kim Alvefur <zash@zash.se>
date Wed, 18 Oct 2017 20:24:47 +0200
parents 2801:cb2342cf3f3c
children 2803:9db18f909b84
files mod_storage_memory/mod_storage_memory.lua
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mod_storage_memory/mod_storage_memory.lua	Wed Oct 18 09:56:29 2017 +0200
+++ b/mod_storage_memory/mod_storage_memory.lua	Wed Oct 18 20:24:47 2017 +0200
@@ -44,9 +44,7 @@
 	end
 	if is_stanza(value) then
 		value = st.preserialize(value);
-		value = function ()
-			return st.deserialize(envload("return "..serialize(value), "@stanza", {}));
-		end
+		value = envload("return xml"..serialize(value), "@stanza", { xml = st.deserialize })
 	else
 		value = envload("return "..serialize(value), "@data", {});
 	end