big change to get metadata working fully in DB and on Filesystem, and recover from most common scenarios, improved GUI as well for allowing an immediate search after adding refimg as well
This commit is contained in:
26
job.py
26
job.py
@@ -171,18 +171,22 @@ def joblog(id):
|
||||
display_more=False
|
||||
order="desc"
|
||||
|
||||
if joblog.pa_job_state == "Completed":
|
||||
duration=(joblog.last_update-joblog.start_time)
|
||||
if joblog.start_time:
|
||||
if joblog.pa_job_state == "Completed":
|
||||
duration=(joblog.last_update-joblog.start_time)
|
||||
elif joblog.start_time:
|
||||
duration=(datetime.now(pytz.utc)-joblog.start_time)
|
||||
duration= duration-timedelta(microseconds=duration.microseconds)
|
||||
estimate=None
|
||||
duration_s = duration.total_seconds()
|
||||
# if job is old, not completed, and we have num_files and current_file_num > 0 so we can work out an estimated duration
|
||||
if duration_s > 300 and joblog.pa_job_state != "Completed" and joblog.current_file_num and joblog.num_files:
|
||||
estimate_s = duration_s / joblog.current_file_num * joblog.num_files
|
||||
estimate = timedelta( seconds=(estimate_s-duration_s) )
|
||||
estimate = estimate - timedelta(microseconds=estimate.microseconds)
|
||||
else:
|
||||
duration=(datetime.now(pytz.utc)-joblog.start_time)
|
||||
duration= duration-timedelta(microseconds=duration.microseconds)
|
||||
estimate=None
|
||||
duration_s = duration.total_seconds()
|
||||
# if job is old, not completed, and we have num_files and current_file_num > 0 so we can work out an estimated duration
|
||||
if duration_s > 300 and joblog.pa_job_state != "Completed" and joblog.current_file_num and joblog.num_files:
|
||||
estimate_s = duration_s / joblog.current_file_num * joblog.num_files
|
||||
estimate = timedelta( seconds=(estimate_s-duration_s) )
|
||||
estimate = estimate - timedelta(microseconds=estimate.microseconds)
|
||||
duration="N/A"
|
||||
estimate=None
|
||||
return render_template("joblog.html", job=joblog, logs=logs, duration=duration, display_more=display_more, order=order, estimate=estimate, refresh=refresh)
|
||||
|
||||
###############################################################################
|
||||
|
||||
Reference in New Issue
Block a user