aboutsummaryrefslogtreecommitdiff
path: root/samplejobs/BWAuthChecker.py
diff options
context:
space:
mode:
Diffstat (limited to 'samplejobs/BWAuthChecker.py')
-rwxr-xr-xsamplejobs/BWAuthChecker.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/samplejobs/BWAuthChecker.py b/samplejobs/BWAuthChecker.py
index 9116857..2b88e95 100755
--- a/samplejobs/BWAuthChecker.py
+++ b/samplejobs/BWAuthChecker.py
@@ -13,6 +13,8 @@ import JobBase
class BWAuthChecker(JobBase.JobBase):
def executeEvery(self):
return JobBase.JobFrequency.HOUR
+ def notifyOnFailureEvery(self):
+ return JobBase.JobFailureNotificationFrequency.EVERYTIME
def execute(self):
body = ""
url = "https://example.com/bwauth/bwscan.V3BandwidthsFile"
@@ -34,6 +36,9 @@ class BWAuthChecker(JobBase.JobBase):
if body:
logging.warn("tor bwauth is broken?")
logging.warn(body)
- return self.sendEmail("tor bwauth is broken?", body)
+ self.logdetails = body
+ return False
else:
return True
+ def onFailure(self):
+ return self.sendEmail("tor bwauth is broken?", self.logdetails)