troubleshooting...

This commit is contained in:
Fredrik Eriksson 2019-07-08 21:14:55 +02:00
parent 1306699036
commit 7a95abc6c0
No known key found for this signature in database
GPG Key ID: 8825C73A0FD1502A

View File

@ -217,7 +217,9 @@ def main():
if previous_runs: if previous_runs:
# Not the first failure... # Not the first failure...
oldest = datetime.datetime.fromtimestamp(min(previous_runs.values())) oldest = datetime.datetime.fromtimestamp(min(previous_runs.values()))
if now-oldest > datetime.timedelta(seconds=args.warn_interval): delta = datetime.timedelta(seconds=args.warn_interval)
diff = now-oldest
if diff > delta:
# we have failed for a long time, send a report # we have failed for a long time, send a report
print("Cronjob is still failing after {} seconds ({} failures)\n".format(args.warn_interval, len(previous_runs))) print("Cronjob is still failing after {} seconds ({} failures)\n".format(args.warn_interval, len(previous_runs)))
print_runs(previous_runs.keys()) print_runs(previous_runs.keys())