]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
predict: fully deactivate prediction with `period = 0`
authorVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 22 Dec 2022 12:58:53 +0000 (13:58 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 22 Dec 2022 13:11:16 +0000 (14:11 +0100)
That setting is recommended by documentation but it would still leave
the timer triggering repeatedly.  Maybe it didn't cause any practical
difference, but it was unnecessary and possibly confusing.

modules/predict/predict.lua

index 4511fc9b90b38b32ed9b340acbc7d897d343bd27..0117fd521bc755213f12653d1cf1135f87b80255 100644 (file)
@@ -140,7 +140,7 @@ function predict.process()
 end
 
 function predict.init()
-       if predict.window > 0 then
+       if predict.window > 0 and predict.period > 0 then
                predict.current_epoch = predict.epoch()
                predict.ev_sample = event.after(next_event(), predict.process)
        end