Mercurial > prosody-modules
comparison mod_reload_modules/mod_reload_modules.lua @ 4946:cc14bfec209b
mod_reload_modules: Be aware of component module (thanks Menel)
Without this, the component module is seen as a module that is loaded
but not configured, and is thus unloaded
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 21 May 2022 14:48:18 +0200 |
| parents | 3b8f4f3b1718 |
| children |
comparison
equal
deleted
inserted
replaced
| 4945:fa415cd9eeca | 4946:cc14bfec209b |
|---|---|
| 6 if not modules then | 6 if not modules then |
| 7 module:log("warn", "No modules listed in the config to reload - set reload_modules to a list"); | 7 module:log("warn", "No modules listed in the config to reload - set reload_modules to a list"); |
| 8 return; | 8 return; |
| 9 end | 9 end |
| 10 local configured_modules = module:get_option_inherited_set("modules_enabled", {}); | 10 local configured_modules = module:get_option_inherited_set("modules_enabled", {}); |
| 11 local component_module = module:get_option_string("component_module"); | |
| 12 if component_module then | |
| 13 -- Ensure awareness of the component module so that it is not unloaded | |
| 14 configured_modules:add(component_module); | |
| 15 end | |
| 16 | |
| 11 -- ignore removed hosts | 17 -- ignore removed hosts |
| 12 if not prosody.hosts[module.host] then | 18 if not prosody.hosts[module.host] then |
| 13 module:log("warn", "Ignoring host %s: host was removed...", module.host); | 19 module:log("warn", "Ignoring host %s: host was removed...", module.host); |
| 14 return; | 20 return; |
| 15 end | 21 end |
