diff options
author | Tom Ritter <tom@ritter.vg> | 2016-05-09 11:35:11 -0400 |
---|---|---|
committer | Tom Ritter <tom@ritter.vg> | 2016-05-09 11:36:03 -0400 |
commit | 72365ece894883a2dd4b2e5add38743e3a1cd509 (patch) | |
tree | ace656ba2eb93fd9e719080d35a97cbf6f3a5835 /jobs | |
parent | 19db484e2b851d9a944e005e47158c4d8cd82b81 (diff) |
Need to compare timedelta to timedelta
Diffstat (limited to 'jobs')
-rwxr-xr-x | jobs/JobBase.py | 6 |
1 files changed, 3 insertions, 3 deletions
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: |