potential fix for datetime calculation
This commit is contained in:
parent
6b3d94141d
commit
1306699036
@ -216,7 +216,7 @@ def main():
|
|||||||
# Failure
|
# Failure
|
||||||
if previous_runs:
|
if previous_runs:
|
||||||
# Not the first failure...
|
# Not the first failure...
|
||||||
oldest = min(previous_runs.values())
|
oldest = datetime.datetime.fromtimestamp(min(previous_runs.values()))
|
||||||
if now-oldest > datetime.timedelta(seconds=args.warn_interval):
|
if now-oldest > datetime.timedelta(seconds=args.warn_interval):
|
||||||
# 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)))
|
||||||
|
Loading…
Reference in New Issue
Block a user