2
0

Fix jobs being added to batch after they might already execute (#35496)

This commit is contained in:
Eugen Rochko
2025-07-28 10:20:12 +02:00
committed by GitHub
parent a57a9505d4
commit 018e5e303f
4 changed files with 52 additions and 12 deletions

View File

@@ -17,7 +17,12 @@ class ActivityPub::FetchRepliesService < BaseService
batch = WorkerBatch.new
batch.connect(async_refresh_key) if async_refresh_key.present?
batch.add_jobs(FetchReplyWorker.push_bulk(@items) { |reply_uri| [reply_uri, { 'request_id' => request_id, 'batch_id' => batch.id }] })
batch.finish! if @items.empty?
batch.within do
FetchReplyWorker.push_bulk(@items) do |reply_uri|
[reply_uri, { 'request_id' => request_id, 'batch_id' => batch.id }]
end
end
[@items, n_pages]
end