diff options
author | Alex Hanselka <alex@gitlab.com> | 2018-12-11 00:42:50 +0300 |
---|---|---|
committer | Alex Hanselka <alex@gitlab.com> | 2018-12-11 00:42:50 +0300 |
commit | f77888fe0857c9f4a47133f434c741a510946767 (patch) | |
tree | b227b60894474ba2c9a8864b66e4df65763b35b8 /app/workers/object_pool/schedule_join_worker.rb | |
parent | d2120ff1e705799752e7d9704cae3f1896d8e186 (diff) | |
parent | 2d7dc668506a0576e231fbe290c89e47cf088300 (diff) |
Merge branch '11-6-stable-prepare-rc5' into '11-6-stable'
Prepare 11.6 RC5 release
See merge request gitlab-org/gitlab-ce!23704
Diffstat (limited to 'app/workers/object_pool/schedule_join_worker.rb')
-rw-r--r-- | app/workers/object_pool/schedule_join_worker.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/workers/object_pool/schedule_join_worker.rb b/app/workers/object_pool/schedule_join_worker.rb new file mode 100644 index 00000000000..647a8b72435 --- /dev/null +++ b/app/workers/object_pool/schedule_join_worker.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module ObjectPool + class ScheduleJoinWorker + include ApplicationWorker + include ObjectPoolQueue + + def perform(pool_id) + pool = PoolRepository.find_by_id(pool_id) + return unless pool&.joinable? + + pool.member_projects.find_each do |project| + next if project.forked? && !project.import_finished? + + ObjectPool::JoinWorker.perform_async(pool.id, project.id) + end + end + end +end |