diff options
-rwxr-xr-x | jobs/JobBase.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/jobs/JobBase.py b/jobs/JobBase.py index 9ea31a4..cf720fe 100755 --- a/jobs/JobBase.py +++ b/jobs/JobBase.py @@ -19,6 +19,7 @@ class JobFailureNotificationFrequency: EVERYFIVEMINUTES = "5min" EVERYTENMINUTES = "10min" EVERYHOUR = "hour" + EVERYDAY = "day" ONSTATECHANGE = "state_change" class JobBase(object): @@ -66,6 +67,12 @@ class JobBase(object): if datetime.timedelta(seconds=(now - lastNotify)) > datetime.timedelta(minutes=59, seconds=0): return True return False + elif notifyFrequency == JobFailureNotificationFrequency.EVERYDAY: + now = time.time() + lastNotify = jobState.LastNotifyTime + if datetime.timedelta(seconds=(now - lastNotify)) > datetime.timedelta(hours=24, minutes=0, seconds=0): + return True + return False elif notifyFrequency == JobFailureNotificationFrequency.ONSTATECHANGE: #Only notify if the last JobState was a Success return jobState.CurrentStateSuccess |