mod_scansion_record: Close files in the cleanup stage of shutdown (fixes use after close)
--- a/plugins/mod_scansion_record.lua Sat Sep 22 14:38:40 2018 +0200
+++ b/plugins/mod_scansion_record.lua Sat Sep 22 15:14:25 2018 +0200
@@ -88,6 +88,9 @@
module:hook_global("server-stopping", function ()
record("# recording ended on "..dt.datetime().."\n");
module:log("info", "Scansion recording available in %s", record_file);
+end);
+
+prosody.events.add_handler("server-cleanup", function ()
scan:close();
head:close()
end);