Skip if cannot find pipeline, feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342/diffs#note_17038807
This commit is contained in:
Lin Jen-Shin 2016-10-17 18:18:16 +08:00
parent 7e1b9196c4
commit 0f21b1313b
1 changed files with 3 additions and 1 deletions

View File

@ -2,7 +2,9 @@ class PipelineNotificationWorker
include Sidekiq::Worker
def perform(pipeline_id, recipients = nil)
pipeline = Ci::Pipeline.find(pipeline_id)
pipeline = Ci::Pipeline.find_by(id: pipeline_id)
return unless pipeline
NotificationService.new.pipeline_finished(pipeline, recipients)
end