Module: Gitlab::BitbucketServerImport::ParallelScheduling

Includes:
Loggable
Included in:
Importers::LfsObjectsImporter, Importers::NotesImporter, Importers::PullRequestsImporter
Defined in:
lib/gitlab/bitbucket_server_import/parallel_scheduling.rb

Constant Summary collapse

ALREADY_PROCESSED_CACHE_KEY =

The base cache key to use for tracking already processed objects.

'bitbucket-server-importer/already-processed/%{project}/%{collection}'
JOB_WAITER_CACHE_KEY =

The base cache key to use for storing job waiter key

'bitbucket-server-importer/job-waiter/%{project}/%{collection}'
BATCH_SIZE =
100

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Loggable

#log_debug, #log_error, #log_info, #log_warn

Instance Attribute Details

#already_processed_cache_keyObject (readonly)

Returns the value of attribute already_processed_cache_key.



8
9
10
# File 'lib/gitlab/bitbucket_server_import/parallel_scheduling.rb', line 8

def already_processed_cache_key
  @already_processed_cache_key
end

#job_waiter_cache_keyObject (readonly)

Returns the value of attribute job_waiter_cache_key.



8
9
10
# File 'lib/gitlab/bitbucket_server_import/parallel_scheduling.rb', line 8

def job_waiter_cache_key
  @job_waiter_cache_key
end

#projectObject (readonly)

Returns the value of attribute project.



8
9
10
# File 'lib/gitlab/bitbucket_server_import/parallel_scheduling.rb', line 8

def project
  @project
end

Instance Method Details

#initialize(project) ⇒ Object

project - An instance of ‘Project`.



21
22
23
24
25
26
27
28
# File 'lib/gitlab/bitbucket_server_import/parallel_scheduling.rb', line 21

def initialize(project)
  @project = project

  @already_processed_cache_key =
    format(ALREADY_PROCESSED_CACHE_KEY, project: project.id, collection: collection_method)
  @job_waiter_cache_key =
    format(JOB_WAITER_CACHE_KEY, project: project.id, collection: collection_method)
end