Module: Gitlab::BitbucketImport::ObjectImporter

Extended by:
ActiveSupport::Concern
Included in:
ImportIssueWorker, ImportPullRequestWorker
Defined in:
app/workers/concerns/gitlab/bitbucket_import/object_importer.rb

Overview

ObjectImporter defines the base behaviour for every Sidekiq worker that imports a single resource such as a note or pull request.

Instance Method Summary collapse

Instance Method Details

#perform(project_id, hash, notify_key) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/workers/concerns/gitlab/bitbucket_import/object_importer.rb', line 30

def perform(project_id, hash, notify_key)
  project = Project.find_by_id(project_id)

  return unless project

  if project.import_state&.canceled?
    info(project.id, message: 'project import canceled')
    return
  end

  import(project, hash)
ensure
  notify_waiter(notify_key)
end