make backoff setting configurable
All checks were successful
dreamfall/clacksme/pipeline/head This commit looks good

This commit is contained in:
Morgan McMillian 2023-01-14 07:28:40 -08:00
parent 8412effa6d
commit b7e016ed1b

View file

@ -84,7 +84,14 @@ class MailboxNotifier(object):
"event_id": uid})
if self.last_check is not None:
delta = now - self.last_check
if delta.seconds > 60:
try:
backoff = System.get(System.key == "backoff")
except System.DoesNotExist:
backoff = System(key="backoff", value="60")
backoff.save()
if delta.seconds > int(backoff.value):
notify = True
else:
notify = True