Class: CleanupContainerRepositoryWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker
Defined in:
app/workers/cleanup_container_repository_worker.rb

Constant Summary

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY, ApplicationWorker::SAFE_PUSH_BULK_LIMIT

Constants included from WorkerAttributes

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Attribute Details

#container_repositoryObject (readonly)

Returns the value of attribute container_repository.


17
18
19
# File 'app/workers/cleanup_container_repository_worker.rb', line 17

def container_repository
  @container_repository
end

#current_userObject (readonly)

Returns the value of attribute current_user.


17
18
19
# File 'app/workers/cleanup_container_repository_worker.rb', line 17

def current_user
  @current_user
end

Instance Method Details

#perform(current_user_id, container_repository_id, params) ⇒ Object


19
20
21
22
23
24
25
26
27
28
29
# File 'app/workers/cleanup_container_repository_worker.rb', line 19

def perform(current_user_id, container_repository_id, params)
  @current_user = User.find_by_id(current_user_id)
  @container_repository = ContainerRepository.find_by_id(container_repository_id)
  @params = params

  return unless valid?

  Projects::ContainerRepository::CleanupTagsService
    .new(container_repository, current_user, params)
    .execute
end