util.startup: Initialize util.async at startup

This commit is contained in:
Matthew Wild 2021-11-29 14:16:20 +00:00
parent d46c43fbeb
commit f89a58330b

View file

@ -402,6 +402,14 @@ function startup.init_promise()
promise.set_nexttick(function(f) return timer.add_task(0, f); end); promise.set_nexttick(function(f) return timer.add_task(0, f); end);
end end
function startup.init_async()
local async = require "util.async";
local timer = require "util.timer";
async.set_nexttick(function(f) return timer.add_task(0, f); end);
async.set_schedule_function(timer.add_task);
end
function startup.init_data_store() function startup.init_data_store()
require "core.storagemanager"; require "core.storagemanager";
end end
@ -655,6 +663,7 @@ function startup.prosody()
startup.log_startup_warnings(); startup.log_startup_warnings();
startup.load_secondary_libraries(); startup.load_secondary_libraries();
startup.init_promise(); startup.init_promise();
startup.init_async();
startup.init_http_client(); startup.init_http_client();
startup.init_data_store(); startup.init_data_store();
startup.init_global_protection(); startup.init_global_protection();