Mercurial > prosody-modules
comparison mod_admin_web/admin_web/mod_admin_web.lua @ 295:e373de5907aa
mod_admin_web: Only create the node once when loading onto multiple hosts
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Fri, 24 Dec 2010 01:59:28 +0100 |
parents | a9e69088e678 |
children | b241c79a0eb7 |
comparison
equal
deleted
inserted
replaced
294:5a619d6045a8 | 295:e373de5907aa |
---|---|
116 | 116 |
117 function module.load() | 117 function module.load() |
118 local host_session = prosody.hosts[host]; | 118 local host_session = prosody.hosts[host]; |
119 local http_conf = config.get("*", "core", "webadmin_http_ports"); | 119 local http_conf = config.get("*", "core", "webadmin_http_ports"); |
120 | 120 |
121 local ok, errmsg = hosts[service].modules.pubsub.service:create(xmlns_sessions, service); | 121 if not select(2, hosts[service].modules.pubsub.service:get_nodes(service))[xmlns_sessions] then |
122 if not ok then | 122 local ok, errmsg = hosts[service].modules.pubsub.service:create(xmlns_sessions, service); |
123 error("Could not create node: " .. tostring(errmsg)); | 123 if not ok then |
124 error("Could not create node: " .. tostring(errmsg)); | |
125 end | |
124 end | 126 end |
125 | 127 |
126 for remotehost, session in pairs(host_session.s2sout) do | 128 for remotehost, session in pairs(host_session.s2sout) do |
127 if session.type ~= "s2sout_unauthed" then | 129 if session.type ~= "s2sout_unauthed" then |
128 add_host(session, "out"); | 130 add_host(session, "out"); |