Module: UpdateRepositoryStorageWorker

Extended by:
ActiveSupport::Concern
Includes:
ApplicationWorker
Included in:
Projects::UpdateRepositoryStorageWorker, Snippets::UpdateRepositoryStorageWorker
Defined in:
app/workers/concerns/update_repository_storage_worker.rb

Constant Summary

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT

Constants included from Gitlab::Loggable

Gitlab::Loggable::ANONYMOUS

Constants included from WorkerAttributes

WorkerAttributes::DEFAULT_DATA_CONSISTENCY, WorkerAttributes::DEFAULT_DEFER_DELAY, WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_DATA_CONSISTENCIES, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Gitlab::Loggable

#build_structured_payload

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(container_id, new_repository_storage_key, repository_storage_move_id = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/workers/concerns/update_repository_storage_worker.rb', line 14

def perform(container_id, new_repository_storage_key, repository_storage_move_id = nil)
  repository_storage_move =
    if repository_storage_move_id
      find_repository_storage_move(repository_storage_move_id)
    else
      # maintain compatibility with workers queued before release
      container = find_container(container_id)
      container.repository_storage_moves.create!(
        source_storage_name: container.repository_storage,
        destination_storage_name: new_repository_storage_key
      )
    end

  update_repository_storage(repository_storage_move)
end