Class: CleanupContainerRepositoryWorker

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

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, 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


10
11
12
# File 'app/workers/cleanup_container_repository_worker.rb', line 10

def container_repository
  @container_repository
end

#current_userObject (readonly)

Returns the value of attribute current_user


10
11
12
# File 'app/workers/cleanup_container_repository_worker.rb', line 10

def current_user
  @current_user
end

Instance Method Details

#perform(current_user_id, container_repository_id, params) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
# File 'app/workers/cleanup_container_repository_worker.rb', line 12

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(project, current_user, params)
    .execute(container_repository)
end