diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-03-22 16:24:22 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-03-22 16:24:22 +0000 |
commit | 2846eb2eb2f74c0d67a0afdfb388846690e54fe2 (patch) | |
tree | d7a3d6749ab34785adf8f3f6960ae800611b3107 | |
parent | 159f8f7bc1509d1bacc07ddb06dd0dc23c4421c0 (diff) | |
download | prosody-2846eb2eb2f74c0d67a0afdfb388846690e54fe2.tar.gz prosody-2846eb2eb2f74c0d67a0afdfb388846690e54fe2.zip |
util.startup: Execute startup routine inside async context
-rw-r--r-- | util/startup.lua | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/util/startup.lua b/util/startup.lua index fbfa772e..1bac7399 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -5,6 +5,7 @@ local startup = {}; local prosody = { events = require "util.events".new() }; local config = require "core.configmanager"; +local async = require "util.async"; local dependencies = require "util.dependencies"; @@ -497,27 +498,29 @@ function startup.prosodyctl() end function startup.prosody() - -- These actions are in a strict order, as many depend on - -- previous steps to have already been performed - startup.read_config(); - startup.sanity_check(); - startup.sandbox_require(); - startup.set_function_metatable(); - startup.check_dependencies(); - startup.load_libraries(); - startup.init_global_state(); - startup.init_logging(); - startup.chdir(); - startup.add_global_prosody_functions(); - startup.read_version(); - startup.log_greeting(); - startup.log_dependency_warnings(); - startup.load_secondary_libraries(); - startup.init_http_client(); - startup.init_data_store(); - startup.init_global_protection(); - startup.prepare_to_start(); - startup.notify_started(); + async.once(function () + -- These actions are in a strict order, as many depend on + -- previous steps to have already been performed + startup.read_config(); + startup.sanity_check(); + startup.sandbox_require(); + startup.set_function_metatable(); + startup.check_dependencies(); + startup.load_libraries(); + startup.init_global_state(); + startup.init_logging(); + startup.chdir(); + startup.add_global_prosody_functions(); + startup.read_version(); + startup.log_greeting(); + startup.log_dependency_warnings(); + startup.load_secondary_libraries(); + startup.init_http_client(); + startup.init_data_store(); + startup.init_global_protection(); + startup.prepare_to_start(); + startup.notify_started(); + end); end return startup; |