I am trying to track metrics around time taken to process a job or duration of the job staring from when it was picked to when it was completed. I use the properties finishedOn and processedOn to calculate the same (job.finishedOn - job.processedOn), but most of the time the finishedOn property returns null.
Since the property is nullable, I am doing something like job.finishedOn || Date.now() - job.processedOn as a workaround in the onWorkerComplete method.
Job should either be completed or failed, curious to know why would finishedOn property would be null?