migrator: Silence assert in core.moduleapi
authorKim Alvefur <zash@zash.se>
Thu, 29 Jul 2021 14:11:29 +0200
changeset 11735 076ceb405b94
parent 11734 9bf8a0607d12
child 11736 5735f931f5c4
migrator: Silence assert in core.moduleapi The assert triggers because we're not loading the stanza route, because we are unlikely to need it during migration.
tools/migration/prosody-migrator.lua
--- a/tools/migration/prosody-migrator.lua	Thu Jul 29 14:10:56 2021 +0200
+++ b/tools/migration/prosody-migrator.lua	Thu Jul 29 14:11:29 2021 +0200
@@ -54,6 +54,10 @@
 	prosody.config_loaded = true;
 	startup.load_libraries();
 	startup.init_http_client();
+	prosody.core_post_stanza = function ()
+		-- silence assert in core.moduleapi
+		error("Attempt to send stanzas from inside migrator.", 0);
+	end
 end
 
 -- Command-line parsing