Fix final job duration handling
What does this MR do?
Fix final job duration handling
With Expose started_at and finished_at values in Usa... (!5484 - merged) we've introduced a new way to track final job duration. That allowed to track this value properly with the new usage logs, but also affected the existing logging and metrics mechanisms.
Unfortunately, this Merge Request introduced a bug that technically have erased the duration value in cases where job succeeds or is failed - so majority of them. The duration is tracked properly only when there is a runner interrupt signal received or when the job is canceled. Which in case of normal operations doesn't happen often.
This change fixes that bug.
Why was this MR needed?
What's the best way to test this MR?
What are the relevant issue numbers?
Edited by Tomasz Maczukin