From dda93565feb7be092cbb2b22b29f5c667da94344 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 2 May 2009 22:01:22 +0100 Subject: modulemanager: Don't load modules when modules_enable is false --- core/modulemanager.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') diff --git a/core/modulemanager.lua b/core/modulemanager.lua index cc48c2f6..2cba50ac 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -53,6 +53,10 @@ local NULL = {}; -- Load modules when a host is activated function load_modules_for_host(host) + if config.get(host, "core", "modules_enable") == false then + return; -- Only load for hosts, not components, etc. + end + -- Load modules from global section local modules_enabled = config.get("*", "core", "modules_enabled"); local modules_disabled = config.get(host, "core", "modules_disabled"); -- cgit v1.2.3 From de88c377e19b89a90af943305dd8905851fa3f77 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 2 May 2009 22:02:43 +0100 Subject: hostmanager: Reduce log output at startup to 'debug' --- core/hostmanager.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/hostmanager.lua b/core/hostmanager.lua index 1fec9799..97c742da 100644 --- a/core/hostmanager.lua +++ b/core/hostmanager.lua @@ -9,6 +9,8 @@ local pairs = pairs; module "hostmanager" +local hosts_loaded_once; + local function load_enabled_hosts(config) local defined_hosts = config or configmanager.getconfig(); @@ -18,13 +20,14 @@ local function load_enabled_hosts(config) end end eventmanager.fire_event("hosts-activated", defined_hosts); + hosts_loaded_once = true; end eventmanager.add_event_hook("server-starting", load_enabled_hosts); function activate(host, host_config) hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {} }; - log("info", "Activated host: %s", host); + log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host); eventmanager.fire_event("host-activated", host, host_config); end -- cgit v1.2.3 From f28e5c887cc99f30a0b290ced40f7b5ab8c236ba Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 2 May 2009 22:03:44 +0100 Subject: componentmanager: Reduce log output at startup to 'debug' --- core/componentmanager.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/componentmanager.lua b/core/componentmanager.lua index 524d334b..93e2ae7b 100644 --- a/core/componentmanager.lua +++ b/core/componentmanager.lua @@ -44,7 +44,7 @@ local function default_component_handler(origin, stanza) end end - +local components_loaded_once; function load_enabled_components(config) local defined_hosts = config or configmanager.getconfig(); @@ -56,7 +56,7 @@ function load_enabled_components(config) if not ok then log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); else - log("info", "Activated %s component: %s", host_config.core.component_module, host); + log("debug", "Activated %s component: %s", host_config.core.component_module, host); end end end -- cgit v1.2.3