prosody: Close the state on exit (ie garbage-collect everything)
authorKim Alvefur <zash@zash.se>
Tue, 18 May 2021 20:08:37 +0200
changeset 11575 a8f0f87e115a
parent 11574 c3896c714a83
child 11576 e06dba5e99b9
prosody: Close the state on exit (ie garbage-collect everything) This ensures __gc is called on everything that may need it, such as database connections. It was reported in the chat by Happy that SQLite3 does not close its state cleanly in WAL mode, leaving the WAL file behind. This is probably rather a bug in mod_storage_sql, but forcing a final GC sweep should also help with such things everywhere.
prosody
--- a/prosody	Mon May 17 16:51:11 2021 +0200
+++ b/prosody	Tue May 18 20:08:37 2021 +0200
@@ -92,4 +92,4 @@
 
 prosody.log("debug", "Shutdown reason was: %s", prosody.shutdown_reason or "not specified");
 prosody.log("debug", "Exiting with status code: %d", prosody.shutdown_code or 0);
-os.exit(prosody.shutdown_code);
+os.exit(prosody.shutdown_code, true);