From 4a0796a1bdeb0889bfda6ad3ee56990ea37469a8 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Tue, 27 Apr 2021 15:02:13 +0200 Subject: [PATCH] fix poller issue with dynamic interval calculating next due must also be done when current poll was not due Change-Id: I18d9cbc61aa6ca66f3fc2dc4cdfa1fce29a87705 --- secop/poller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/secop/poller.py b/secop/poller.py index c7139c3..0a7de8e 100644 --- a/secop/poller.py +++ b/secop/poller.py @@ -202,7 +202,7 @@ class Poller(PollerBase): module.pollOneParam(pname) done = True lastdue = due - due = max(lastdue + mininterval, now + min(self.maxwait, mininterval * 0.5)) + due = max(lastdue + mininterval, now + min(self.maxwait, mininterval * 0.5)) # replace due, lastdue with new values and sort in heapreplace(queue, (due, lastdue, pollitem)) return 0