Diff

plugins/mod_external_services.lua @ 13209:c8d949cf6b09

plugins: Switch to :get_option_period() for time range options Improves readability ("1 day" vs 86400) and centralizes validation.
author Kim Alvefur <zash@zash.se>
date Sun, 16 Jul 2023 20:49:33 +0200
parent 12977:74b9e05af71e
child 13213:50324f66ca2a
line wrap: on
line diff
--- a/plugins/mod_external_services.lua	Sun Jul 16 21:04:42 2023 +0200
+++ b/plugins/mod_external_services.lua	Sun Jul 16 20:49:33 2023 +0200
@@ -10,7 +10,7 @@
 local default_host = module:get_option_string("external_service_host", module.host);
 local default_port = module:get_option_number("external_service_port");
 local default_secret = module:get_option_string("external_service_secret");
-local default_ttl = module:get_option_number("external_service_ttl", 86400);
+local default_ttl = module:get_option_period("external_service_ttl", "1 day");
 
 local configured_services = module:get_option_array("external_services", {});