From 72365ece894883a2dd4b2e5add38743e3a1cd509 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Mon, 9 May 2016 11:35:11 -0400 Subject: Need to compare timedelta to timedelta --- jobs/JobBase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jobs/JobBase.py') diff --git a/jobs/JobBase.py b/jobs/JobBase.py index 427dd17..09a8333 100755 --- a/jobs/JobBase.py +++ b/jobs/JobBase.py @@ -51,19 +51,19 @@ class JobBase(object): elif notifyFrequency == JobFailureNotificationFrequency.EVERYFIVEMINUTES: now = time.time() lastNotify = jobState.LastNotifyTime - if now - lastNotify > datetime.timedelta(minutes=4, seconds=30): + if datetime.timedelta(seconds=(now - lastNotify)) > datetime.timedelta(minutes=4, seconds=30): return True return False elif notifyFrequency == JobFailureNotificationFrequency.EVERYTENMINUTES: now = time.time() lastNotify = jobState.LastNotifyTime - if now - lastNotify > datetime.timedelta(minutes=9, seconds=15): + if datetime.timedelta(seconds=(now - lastNotify)) > datetime.timedelta(minutes=9, seconds=15): return True return False elif notifyFrequency == JobFailureNotificationFrequency.EVERYHOUR: now = time.time() lastNotify = jobState.LastNotifyTime - if now - lastNotify > datetime.timedelta(minutes=59, seconds=0): + if datetime.timedelta(seconds=(now - lastNotify)) > datetime.timedelta(minutes=59, seconds=0): return True return False elif notifyFrequency == JobFailureNotificationFrequency.ONSTATECHANGE: -- cgit v1.2.3