From 129b2869e2da66c3cc2b34e3fc1a0663283a44c7 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Fri, 3 Mar 2017 14:50:31 -0600 Subject: Hopefully finally solve the bug about only getting success messages for state change alerts --- jobstate.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'jobstate.py') diff --git a/jobstate.py b/jobstate.py index a8e6542..f3e7796 100644 --- a/jobstate.py +++ b/jobstate.py @@ -14,6 +14,8 @@ class JobState: self.NumFailures = 0 def markFailedAndNotify(self): + # Confusing: In this function 'self' represents the lastRunStatus + # and we know the current run has failed if self.CurrentStateSuccess: self.CurrentStateSuccess = False self.FirstFailureTime = time.time() @@ -24,8 +26,9 @@ class JobState: self.NumFailures += 1 def markFailedNoNotify(self): + # Confusing: In this function 'self' represents the lastRunStatus + # and we know the current run has failed if self.CurrentStateSuccess: - logging.warn("Somehow we called markFailedNoNotify, on a success condition, without notifying the user") self.CurrentStateSuccess = False self.FirstFailureTime = time.time() self.LastNotifyTime = 0 @@ -34,6 +37,8 @@ class JobState: self.NumFailures += 1 def markSuccessful(self): + # Confusing: In this function 'self' represents the lastRunStatus + # and we know the current run has succeeded if self.CurrentStateSuccess: pass else: -- cgit v1.2.3