util.startup: Initialize the 'prosody' global earlier (various things needs the global util.events instance)
authorKim Alvefur <zash@zash.se>
Thu, 29 Mar 2018 16:36:18 +0200
changeset 8702 580c13ed0ca1
parent 8701 0499f3da0ec4
child 8703 d611c46c6787
util.startup: Initialize the 'prosody' global earlier (various things needs the global util.events instance)
util/startup.lua
--- a/util/startup.lua	Thu Mar 29 16:27:11 2018 +0200
+++ b/util/startup.lua	Thu Mar 29 16:36:18 2018 +0200
@@ -496,8 +496,8 @@
 
 -- prosodyctl only
 function startup.prosodyctl()
+	startup.init_global_state();
 	startup.read_config();
-	startup.init_global_state();
 	startup.setup_plugindir();
 	startup.setup_datadir();
 	startup.chdir();
@@ -517,13 +517,13 @@
 function startup.prosody()
 	-- These actions are in a strict order, as many depend on
 	-- previous steps to have already been performed
+	startup.init_global_state();
 	startup.read_config();
 	startup.sanity_check();
 	startup.sandbox_require();
 	startup.set_function_metatable();
 	startup.check_dependencies();
 	startup.load_libraries();
-	startup.init_global_state();
 	startup.setup_plugindir();
 	startup.setup_datadir();
 	startup.init_logging();