Update warning and error timings
This commit is contained in:
parent
02c10e0c78
commit
b4a1d99ae1
|
@ -11,10 +11,10 @@ class Repo(models.Model):
|
||||||
last_modified = models.DateTimeField()
|
last_modified = models.DateTimeField()
|
||||||
label = models.OneToOneField(Label, on_delete=models.CASCADE, unique=True)
|
label = models.OneToOneField(Label, on_delete=models.CASCADE, unique=True)
|
||||||
|
|
||||||
def warning(self, hours_ago=2):
|
def warning(self, hours_ago=4):
|
||||||
return not self.latest_archive().start > datetime.utcnow() - timedelta(hours=hours_ago)
|
return not self.latest_archive().start > datetime.utcnow() - timedelta(hours=hours_ago)
|
||||||
|
|
||||||
def error(self, hours_ago=4):
|
def error(self, hours_ago=12):
|
||||||
latest_archive = self.latest_archive()
|
latest_archive = self.latest_archive()
|
||||||
if latest_archive is None or not self.archive_after_latest_error():
|
if latest_archive is None or not self.archive_after_latest_error():
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue
Block a user