Add button to load new replies in web UI (#35210)
This commit is contained in:
@@ -6,7 +6,7 @@ class ActivityPub::FetchRepliesService < BaseService
|
||||
# Limit of fetched replies
|
||||
MAX_REPLIES = 5
|
||||
|
||||
def call(reference_uri, collection_or_uri, max_pages: 1, allow_synchronous_requests: true, request_id: nil)
|
||||
def call(reference_uri, collection_or_uri, max_pages: 1, allow_synchronous_requests: true, async_refresh_key: nil, request_id: nil)
|
||||
@reference_uri = reference_uri
|
||||
@allow_synchronous_requests = allow_synchronous_requests
|
||||
|
||||
@@ -14,7 +14,10 @@ class ActivityPub::FetchRepliesService < BaseService
|
||||
return if @items.nil?
|
||||
|
||||
@items = filter_replies(@items)
|
||||
FetchReplyWorker.push_bulk(@items) { |reply_uri| [reply_uri, { 'request_id' => request_id }] }
|
||||
|
||||
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 }] })
|
||||
|
||||
[@items, n_pages]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user