752e9c18a1
This action doesn't lean on reduplication, so a short call can me made to the Gitaly server to have the object pool remove its remote to the project pending deletion. https://gitlab.com/gitlab-org/gitaly/blob/f6cd55357/internal/git/objectpool/link.go#L58 When an object pool doesn't have members, this would invalidate the need for a pool. So when a project leaves the pool, the pool will be destroyed on the background. Fixes: https://gitlab.com/gitlab-org/gitaly/issues/1415
16 lines
329 B
Ruby
16 lines
329 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ObjectPool
|
|
class DestroyWorker
|
|
include ApplicationWorker
|
|
include ObjectPoolQueue
|
|
|
|
def perform(pool_repository_id)
|
|
pool = PoolRepository.find_by_id(pool_repository_id)
|
|
return unless pool&.obsolete?
|
|
|
|
pool.delete_object_pool
|
|
pool.destroy
|
|
end
|
|
end
|
|
end
|