Comparison

core/moduleapi.lua @ 13208:a7c6ea1c5308

core.moduleapi: Accept boolean false to disable period setting
author Kim Alvefur <zash@zash.se>
date Sun, 16 Jul 2023 21:04:42 +0200
parent 13207:c563da1694bf
child 13211:4d4f9e42bcf8
comparison
equal deleted inserted replaced
13207:c563da1694bf 13208:a7c6ea1c5308
261 self:log("debug", "Treating negative period as infinity"); 261 self:log("debug", "Treating negative period as infinity");
262 return math.huge; 262 return math.huge;
263 end 263 end
264 -- assume seconds 264 -- assume seconds
265 return value; 265 return value;
266 elseif value == "never" then 266 elseif value == "never" or value == false then
267 -- usually for disabling some periodic thing 267 -- usually for disabling some periodic thing
268 return math.huge; 268 return math.huge;
269 elseif type(value) == "string" then 269 elseif type(value) == "string" then
270 local ret = human_io.parse_duration(value); 270 local ret = human_io.parse_duration(value);
271 if value ~= nil and ret == nil then 271 if value ~= nil and ret == nil then