From 228e580defecfe4a0fdff12d64d0e5a0144101e8 Mon Sep 17 00:00:00 2001 From: Jay Clark <84106309+jayeclark@users.noreply.github.com> Date: Fri, 12 Nov 2021 10:31:41 -0400 Subject: [PATCH] Fix next_job timer logic. By @jayeclark (#1100) --- src/vorta/scheduler.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/vorta/scheduler.py b/src/vorta/scheduler.py index 4add811c..5fb26f1c 100644 --- a/src/vorta/scheduler.py +++ b/src/vorta/scheduler.py @@ -118,10 +118,13 @@ class VortaScheduler(QtCore.QObject): @property def next_job(self): - next_job = dt.now() + next_job = now = dt.now() next_profile = None for profile_id, timer in self.timers.items(): - if timer['dt'] > next_job and timer['qtt'].isActive(): + if next_job == now and timer['dt'] > next_job and timer['qtt'].isActive(): + next_job = timer['dt'] + next_profile = profile_id + elif next_job > now and timer['dt'] < next_job and timer['qtt'].isActive(): next_job = timer['dt'] next_profile = profile_id