debian-mirror-gitlab/app/workers/object_pool/join_worker.rb
2021-06-08 01:23:25 +05:30

23 lines
602 B
Ruby

# frozen_string_literal: true
module ObjectPool
class JoinWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
sidekiq_options retry: 3
include ObjectPoolQueue
worker_resource_boundary :cpu
# The use of pool id is deprecated. Keeping the argument allows old jobs to
# still be performed.
def perform(_pool_id, project_id)
project = Project.find_by_id(project_id)
return unless project&.pool_repository&.joinable?
project.link_pool_repository
Repositories::HousekeepingService.new(project).execute
end
end
end