comparison plugins/mod_limits.lua @ 11550:929de6ade6b6 0.11

mod_limits: Don't emit error when no burst period is configured
author Matthew Wild <mwild1@gmail.com>
date Tue, 11 May 2021 14:10:26 +0100
parents 60e113f3682f
children db8e41eb6eff
comparison
equal deleted inserted replaced
11549:5a484bd050a7 11550:929de6ade6b6
29 local function parse_burst(burst, sess_type) 29 local function parse_burst(burst, sess_type)
30 if type(burst) == "string" then 30 if type(burst) == "string" then
31 burst = burst:match("^(%d+) ?s$"); 31 burst = burst:match("^(%d+) ?s$");
32 end 32 end
33 local n_burst = tonumber(burst); 33 local n_burst = tonumber(burst);
34 if not n_burst then 34 if burst and not n_burst then
35 module:log("error", "Unable to parse burst for %s: %q, using default burst interval (%ds)", sess_type, tostring(burst), default_burst); 35 module:log("error", "Unable to parse burst for %s: %q, using default burst interval (%ds)", sess_type, tostring(burst), default_burst);
36 end 36 end
37 return n_burst or default_burst; 37 return n_burst or default_burst;
38 end 38 end
39 39