modules/predict: don't skip reconfiguration if nil is passed

If you didn't specify any configuration (i.e. nil), the stats module
wouldn't get loaded even though the defaults need it to work.
Now we don't skip that part and pass whole .config() even on nil config.
parent a943fca9
Knot Resolver 3.x.y (2019-0m-dd)
================================
Bugfixes
--------
- predict module: load stats module if config didn't specify period (!755)
Knot Resolver 3.2.1 (2019-01-10)
================================
......
......@@ -158,7 +158,10 @@ end
function predict.config(config)
-- Reconfigure
if type(config) ~= 'table' then return end
config = config or {}
if type(config) ~= 'table' then
error('[predict] configuration must be a table or nil')
end
if config.window then predict.window = config.window end
if config.period then predict.period = config.period end
-- Load dependent modules
......
-- setup resolver
modules = { 'predict', 'stats' }
modules = { 'predict' }
-- mock global functions
local resolve_count = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment