From 0f21b1313b853d92b722b32ac25b8ad6a4860a63 Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin <godfat@godfat.org> Date: Mon, 17 Oct 2016 18:18:16 +0800 Subject: [PATCH] Skip if cannot find pipeline, feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6342/diffs#note_17038807 --- app/workers/pipeline_notification_worker.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/workers/pipeline_notification_worker.rb b/app/workers/pipeline_notification_worker.rb index f4e9a4cf245..68e72f7382f 100644 --- a/app/workers/pipeline_notification_worker.rb +++ b/app/workers/pipeline_notification_worker.rb @@ -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 -- GitLab