diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-10-17 18:09:43 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-10-17 18:09:53 +0800 |
commit | b4e751557ad35d7c5fbed55328892c43a4c84ba5 (patch) | |
tree | 8d7f5fdd1558a66194205dc1a1672640dccd7838 | |
parent | 98217bc0674253f30dea3892a8e833436b89d5b9 (diff) | |
download | gitlab-ce-b4e751557ad35d7c5fbed55328892c43a4c84ba5.tar.gz |
Use run_after_commit to avoid race condition, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342/diffs#note_17038749
-rw-r--r-- | app/models/ci/pipeline.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 0ed1c496022..2a0865abd4b 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -84,7 +84,9 @@ module Ci end after_transition any => [:success, :failed] do |pipeline| - SendPipelineNotificationWorker.perform_async(pipeline.id) + pipeline.run_after_commit do + SendPipelineNotificationWorker.perform_async(pipeline.id) + end end end |