From 9b25f65ca655a567873c66c2b015884a3e013276 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Mon, 25 Jan 2016 21:24:41 -0500 Subject: Initial commit of checker --- statustracker.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 statustracker.py (limited to 'statustracker.py') diff --git a/statustracker.py b/statustracker.py new file mode 100755 index 0000000..2c3350c --- /dev/null +++ b/statustracker.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import time +import logging + +class StatusTracker: + emailNotificationsAreWorking = False + lastRunJob = 0 + def __init__(self, config): + self.emailNotificationsAreWorking = False + self.lastRunJob = 0 + self.config = config + + def isAllGood(self): + return self.emailNotificationsAreWorking and \ + time.time() - self.lastRunJob < 120 + + def markJobRan(self): + self.lastRunJob = time.time() + + def markEmailStatus(self, working): + self.emailNotificationsAreWorking = working \ No newline at end of file -- cgit v1.2.3