mod_external_services: Also validate services added by other modules
authorKim Alvefur <zash@zash.se>
Mon, 21 Jun 2021 22:38:30 +0200
changeset 11630 ef62d29c8fdc
parent 11629 04abe65b8067
child 11631 3a5212fd7e8e
mod_external_services: Also validate services added by other modules This ensures that problems with entries added other modules, e.g. mod_turn_external, are reported on startup. However, this depends on load order and whether a `module:depends()` call comes before the `module:add_item()` call. A followup commit will do something about that.
plugins/mod_external_services.lua
--- a/plugins/mod_external_services.lua	Mon Jun 21 17:31:17 2021 +0200
+++ b/plugins/mod_external_services.lua	Mon Jun 21 22:38:30 2021 +0200
@@ -100,7 +100,8 @@
 
 function module.load()
 	-- Trigger errors on startup
-	local services = configured_services / prepare;
+	local extras = module:get_host_items("external_service");
+	local services = ( configured_services + extras ) / prepare;
 	if #services == 0 then
 		module:log("warn", "No services configured or all had errors");
 	end