Batch - ensure that logs are posted in chronological order (#4710)

This commit is contained in:
Todd Morse 2021-12-22 05:29:27 -05:00 committed by GitHub
parent 0bc45963da
commit 80e3b3574d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -618,6 +618,7 @@ class Job(threading.Thread, BaseModel, DockerModel):
)
date = unix_time_millis(date_obj)
logs.append({"timestamp": date, "message": line.strip()})
logs = sorted(logs, key=lambda l: l["timestamp"])
# Send to cloudwatch
log_group = "/aws/batch/job"