def report_down(self): self.down_count += 1 timeout_time = datetime.timedelta(seconds=60 * self.down_count) self.attempt_connection_at = utils.today() + timeout_time
def is_available(self): if self.attempt_connection_at is None or utils.today() > self.attempt_connection_at: return True return False