Skip to content

Commit

Permalink
Format duration
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaehn committed Dec 21, 2023
1 parent 47da701 commit b0dd12a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,17 @@ def log_job_status(self, job, status, launch_time, duration=None):
with open(log_file, 'w') as f:
f.write(header)

# Log the job information
# Format duration and job_id
if job == 'chain':
if duration is not None:
duration = self.format_duration(duration)
job_id = ''
else:
if duration is not None:
duration = f"{str(int(duration.total_seconds()))} s"
job_id = self.job_id

# Log the job information
launch_time = launch_time.strftime("%a %b %d %Y %H:%M:%S")
if status == 'FINISH' and duration:
log_entry = f"{job:<15} {job_id:<21} {status:<6} {launch_time:<24} {duration}\n"
Expand Down

0 comments on commit b0dd12a

Please sign in to comment.