diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-02-05 19:52:46 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-02-06 09:50:08 +0300 |
commit | a2d79e1f2c8186fa69a91717b3d4e71a332d8bbf (patch) | |
tree | 4927baf9766d7edc4e8ab5d7a62af8686a965e34 /app/workers | |
parent | d30e71b381b9cf33ed61b04c25c258c11942c79b (diff) |
Reorder async/sync tasks in BuildFinishedWorker to read traces efficiently
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/build_finished_worker.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/workers/build_finished_worker.rb b/app/workers/build_finished_worker.rb index 2acf0d14ff5..b5ed8d607b3 100644 --- a/app/workers/build_finished_worker.rb +++ b/app/workers/build_finished_worker.rb @@ -6,8 +6,11 @@ class BuildFinishedWorker def perform(build_id) Ci::Build.find_by(id: build_id).try do |build| - BuildTraceSectionsWorker.perform_async(build.id) - BuildCoverageWorker.perform_async(build.id) + # We execute that in sync as this access the files in order to access local file, and reduce IO + BuildTraceSectionsWorker.new.perform(build.id) + BuildCoverageWorker.new.perform(build.id) + + # We execute that async as this are two indepentent operations that can be executed after TraceSections and Coverage BuildHooksWorker.perform_async(build.id) CreateTraceArtifactWorker.perform_async(build.id) end |