mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-07 18:31:07 +00:00
Extract fetch all replies batch methods
This commit is contained in:
parent
1c4cbd0982
commit
368767a702
|
@ -36,11 +36,14 @@ class Api::V1::Statuses::ContextsController < Api::BaseController
|
||||||
add_async_refresh_header(async_refresh)
|
add_async_refresh_header(async_refresh)
|
||||||
elsif current_account.present? && @status.should_fetch_replies?
|
elsif current_account.present? && @status.should_fetch_replies?
|
||||||
add_async_refresh_header(AsyncRefresh.create(refresh_key))
|
add_async_refresh_header(AsyncRefresh.create(refresh_key))
|
||||||
|
queue_fetch_replies_worker_batch
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
WorkerBatch.new.within do |batch|
|
def queue_fetch_replies_worker_batch
|
||||||
batch.connect(refresh_key, threshold: 1.0)
|
WorkerBatch.new.within do |batch|
|
||||||
ActivityPub::FetchAllRepliesWorker.perform_async(@status.id, { 'batch_id' => batch.id })
|
batch.connect(refresh_key, threshold: 1.0)
|
||||||
end
|
ActivityPub::FetchAllRepliesWorker.perform_async(@status.id, { 'batch_id' => batch.id })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user