provide estimates, format dates better
This commit is contained in:
8
job.py
8
job.py
@@ -134,7 +134,13 @@ def joblog(id):
|
||||
else:
|
||||
duration=(datetime.now(pytz.utc)-joblog.start_time)
|
||||
duration= duration-timedelta(microseconds=duration.microseconds)
|
||||
return render_template("joblog.html", job=joblog, logs=logs, log_cnt=log_cnt, duration=duration, page_title=page_title, first_logs_only=first_logs_only)
|
||||
estimate=None
|
||||
duration_s = duration.total_seconds()
|
||||
if duration_s > 300 and joblog.pa_job_state != "Completed":
|
||||
estimate_s = duration_s / joblog.current_file_num * joblog.num_files
|
||||
estimate = timedelta( seconds=(estimate_s-duration_s) )
|
||||
estimate = estimate - timedelta(microseconds=estimate.microseconds)
|
||||
return render_template("joblog.html", job=joblog, logs=logs, log_cnt=log_cnt, duration=duration, page_title=page_title, first_logs_only=first_logs_only, estimate=estimate)
|
||||
|
||||
###############################################################################
|
||||
# /job/<id> -> GET -> shows status/history of jobs
|
||||
|
||||
Reference in New Issue
Block a user