Diff

plugins/mod_limits.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
line wrap: on
line diff
--- a/plugins/mod_limits.lua	Sun Jul 16 21:04:42 2023 +0200
+++ b/plugins/mod_limits.lua	Sun Jul 16 20:49:33 2023 +0200
@@ -7,7 +7,7 @@
 local ceil = math.ceil;
 
 local limits_cfg = module:get_option("limits", {});
-local limits_resolution = module:get_option_number("limits_resolution", 1);
+local limits_resolution = module:get_option_period("limits_resolution", 1);
 
 local default_bytes_per_second = 3000;
 local default_burst = 2;