| Index: scheduler/scheduler_models.py
|
| diff --git a/scheduler/scheduler_models.py b/scheduler/scheduler_models.py
|
| index 0a6ae7b3a6b5274e7a1937ceddb3a389dbc15c98..870914d5de0b2a3d3aa76d211b15058762ac059d 100644
|
| --- a/scheduler/scheduler_models.py
|
| +++ b/scheduler/scheduler_models.py
|
| @@ -892,6 +892,7 @@ class Job(DBObject):
|
| WHERE t.job_idx = j.job_idx
|
| AND s.status_idx = t.status
|
| AND j.afe_job_id = %s
|
| + ORDER BY t.reason
|
| """ % self.id)
|
|
|
| failed_rows = [r for r in rows if not 'GOOD' in r]
|
| @@ -927,11 +928,15 @@ class Job(DBObject):
|
|
|
| if time_row:
|
| t_begin, t_end = time_row[0]
|
| - delta = t_end - t_begin
|
| - minutes, seconds = divmod(delta.seconds, 60)
|
| - hours, minutes = divmod(minutes, 60)
|
| - stats['execution_time'] = ("%02d:%02d:%02d" %
|
| - (hours, minutes, seconds))
|
| + try:
|
| + delta = t_end - t_begin
|
| + minutes, seconds = divmod(delta.seconds, 60)
|
| + hours, minutes = divmod(minutes, 60)
|
| + stats['execution_time'] = ("%02d:%02d:%02d" %
|
| + (hours, minutes, seconds))
|
| + # One of t_end or t_begin are None
|
| + except TypeError:
|
| + stats['execution_time'] = '(could not determine)'
|
| else:
|
| stats['execution_time'] = '(none)'
|
|
|
|
|