monitor/sched: fix a non obvious logic error A combination of small _step and infrequent enough cron rule could lead to a starvation of things to run (the runnable list remains void forever).
1 files changed, 2 insertions(+), 1 deletions(-) M rework/monitor.py
M rework/monitor.py +2 -1
@@ 153,13 153,14 @@ class scheduler: if not self.runnable: lastnow = self.laststamp + now = datetime.now(TZ) # time to build the next runnable batch self.runnable = list( sorted( iter_stamps_from_cronrules( self.rulemap, lastnow + timedelta(milliseconds=1), - lastnow + timedelta(**self._step) + now + timedelta(**self._step) ), key=lambda stamp_func: stamp_func[0] )