In the job processor, we rely on the started_at field, and simply compute the finished_at field, using the duration of the job. This is somewhat problematic, as some jobs may legitimately have a missing started_at field. The most prominent example are jobs that were enqueued for so long that they timed out, and were marked as "failed". Since they never started, the started_at field is NULL.
However, any job that has a status of success or failed (the jobs we process) will essentially always have a non-null finished_at field (skipped and cancelled jobs can have this field missing, but we don't process those). We should rely on this field when processing jobs, so that a started_at value of NULL doesn't lead to inaccurate data.
In the job processor, we rely on the
started_atfield, and simply compute thefinished_atfield, using the duration of the job. This is somewhat problematic, as some jobs may legitimately have a missingstarted_atfield. The most prominent example are jobs that were enqueued for so long that they timed out, and were marked as "failed". Since they never started, thestarted_atfield isNULL.However, any job that has a status of
successorfailed(the jobs we process) will essentially always have a non-nullfinished_atfield (skippedandcancelledjobs can have this field missing, but we don't process those). We should rely on this field when processing jobs, so that astarted_atvalue ofNULLdoesn't lead to inaccurate data.