Fix next_job timer logic. By @jayeclark (#1100)

This commit is contained in:
Jay Clark 2021-11-12 10:31:41 -04:00 committed by GitHub
parent b38e986683
commit 228e580def
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -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