-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Description
In a recent commit, job.duration has been introduced, which computes the job's duration by substracting scheduled_at from finished_at. However, scheduled_at isn't always set because jobs can simply be enqueued with perform_later and Rails will not always set it (that's my guess from our production systems).
This prevents the show page for jobs to load for us:
Completed 500 Internal Server Error in 15ms (ActiveRecord: 3.6ms (6 queries, 0 cached) | GC: 0.0ms)
59: </td>
ActionView::Template::Error (can't convert NilClass into an exact number)
Caused by: TypeError (can't convert NilClass into an exact number)
58: <%= job.duration.round(3) %> seconds
Started GET "/jobs/applications/<redacted>/jobs/<redacted>
A possible fix would be to fetch created_at if scheduled_at hasn't been set?
Josyann, whitemerry and ric2b
Metadata
Metadata
Assignees
Labels
No labels