Update duration at the end of pipeline
What does this MR do?
Moves duration calculation to be done only once at the end of pipeline processing. Currently this is done every one build.
Why was this MR needed?
This is the simplest thing that we can do before properly implementing duration calculation: #23523 (comment 17145614)
This is ~Performance improvement that significantly affects: http://performance.gitlab.net/dashboard/db/sidekiq-workers?var-worker=PipelineUpdateWorker%23perform&var-database=Production&from=now-1h&to=now
Does this MR meet the acceptance criteria?
- CHANGELOG entry added
- Documentation created/updated
- API support added
- Added for this feature/bug
- All builds are passing
- Conform by the merge request performance guides
- Conform by the style guides
Branch has no merge conflicts with
master(if it does - rebase it please)
- Squashed related commits together