Mercurial > prosody-hg
comparison plugins/mod_scansion_record.lua @ 9366:9472b4044fc6
mod_scansion_record: Close files in the cleanup stage of shutdown (fixes use after close)
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 22 Sep 2018 15:14:25 +0200 |
| parents | acb316319dc0 |
| children | 577c3a7f5045 |
comparison
equal
deleted
inserted
replaced
| 9365:acb316319dc0 | 9366:9472b4044fc6 |
|---|---|
| 86 ]] | 86 ]] |
| 87 | 87 |
| 88 module:hook_global("server-stopping", function () | 88 module:hook_global("server-stopping", function () |
| 89 record("# recording ended on "..dt.datetime().."\n"); | 89 record("# recording ended on "..dt.datetime().."\n"); |
| 90 module:log("info", "Scansion recording available in %s", record_file); | 90 module:log("info", "Scansion recording available in %s", record_file); |
| 91 end); | |
| 92 | |
| 93 prosody.events.add_handler("server-cleanup", function () | |
| 91 scan:close(); | 94 scan:close(); |
| 92 head:close() | 95 head:close() |
| 93 end); | 96 end); |
