# HG changeset patch # User Matthew Wild # Date 1293423884 0 # Node ID 0f53c88bab9a4f402967d66c3ce24870291f9af8 # Parent 50abf9922e6e3638af2393751ef9061a80213e44 mod_admin_web: Move pubsub service initialisation into a server-started handler, in case we get loaded before the service diff -r 50abf9922e6e -r 0f53c88bab9a mod_admin_web/admin_web/mod_admin_web.lua --- a/mod_admin_web/admin_web/mod_admin_web.lua Mon Dec 27 04:24:34 2010 +0100 +++ b/mod_admin_web/admin_web/mod_admin_web.lua Mon Dec 27 04:24:44 2010 +0000 @@ -151,6 +151,10 @@ local host_session = prosody.hosts[host]; local http_conf = config.get("*", "core", "webadmin_http_ports"); + httpserver.new_from_config(http_conf, handle_file_request, { base = "admin" }); +end + +module:hook("server-started", function () if not select(2, hosts[service].modules.pubsub.service:get_nodes(service))[xmlns_s2s_session] then local ok, errmsg = hosts[service].modules.pubsub.service:create(xmlns_s2s_session, service); if not ok then @@ -181,9 +185,7 @@ add_client(session); end end - - httpserver.new_from_config(http_conf, handle_file_request, { base = "admin" }); -end +end); module:hook("resource-bind", function(event) add_client(event.session);