Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/concerns/gitlab/github_import/stage_methods.rb')
-rw-r--r--app/workers/concerns/gitlab/github_import/stage_methods.rb22
1 files changed, 17 insertions, 5 deletions
diff --git a/app/workers/concerns/gitlab/github_import/stage_methods.rb b/app/workers/concerns/gitlab/github_import/stage_methods.rb
index 75db5589415..80013ff3cd9 100644
--- a/app/workers/concerns/gitlab/github_import/stage_methods.rb
+++ b/app/workers/concerns/gitlab/github_import/stage_methods.rb
@@ -3,6 +3,21 @@
module Gitlab
module GithubImport
module StageMethods
+ extend ActiveSupport::Concern
+
+ included do
+ include ApplicationWorker
+
+ sidekiq_retries_exhausted do |msg, e|
+ Gitlab::Import::ImportFailureService.track(
+ project_id: msg['args'][0],
+ exception: e,
+ error_source: self.class.name,
+ fail_import: true
+ )
+ end
+ end
+
# project_id - The ID of the GitLab project to import the data into.
def perform(project_id)
info(project_id, message: 'starting stage')
@@ -29,7 +44,8 @@ module Gitlab
project_id: project_id,
exception: e,
error_source: self.class.name,
- fail_import: abort_on_failure
+ fail_import: false,
+ metrics: true
)
raise(e)
@@ -51,10 +67,6 @@ module Gitlab
# rubocop: enable CodeReuse/ActiveRecord
end
- def abort_on_failure
- false
- end
-
private
def info(project_id, extra = {})