Diff

plugins/mod_turn_external.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_turn_external.lua	Sun Jul 16 21:04:42 2023 +0200
+++ b/plugins/mod_turn_external.lua	Sun Jul 16 20:49:33 2023 +0200
@@ -4,7 +4,7 @@
 local host = module:get_option_string("turn_external_host", module.host);
 local user = module:get_option_string("turn_external_user");
 local port = module:get_option_number("turn_external_port", 3478);
-local ttl = module:get_option_number("turn_external_ttl", 86400);
+local ttl = module:get_option_period("turn_external_ttl", "1 day");
 local tcp = module:get_option_boolean("turn_external_tcp", false);
 local tls_port = module:get_option_number("turn_external_tls_port");