aboutsummaryrefslogtreecommitdiff
path: root/statustracker.py
blob: 2c3350cb070bacf8b3c7bc89d0cebe71b94822d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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