debian-mirror-gitlab/app/workers/object_pool/join_worker.rb

20 lines
486 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module ObjectPool
class JoinWorker
include ApplicationWorker
include ObjectPoolQueue
2019-03-02 22:35:43 +05:30
# The use of pool id is deprecated. Keeping the argument allows old jobs to
# still be performed.
def perform(_pool_id, project_id)
2019-02-15 15:39:39 +05:30
project = Project.find_by_id(project_id)
2019-03-02 22:35:43 +05:30
return unless project&.pool_repository&.joinable?
2019-02-15 15:39:39 +05:30
2019-03-02 22:35:43 +05:30
project.link_pool_repository
2019-02-15 15:39:39 +05:30
Projects::HousekeepingService.new(project).execute
end
end
end