Update activity pub jobs
• Update: - activity pub jobs to retry 0 and dead: true • Remove: - ActivityPub DeliveryWorker on account suspension - Inbox, outbox, collections routes
This commit is contained in:
parent
1f9e33a80b
commit
f7a0b022d4
|
@ -10,8 +10,8 @@ class ActivityPub::InboxesController < Api::BaseController
|
||||||
if unknown_deleted_account?
|
if unknown_deleted_account?
|
||||||
head 202
|
head 202
|
||||||
elsif signed_request_account
|
elsif signed_request_account
|
||||||
upgrade_account
|
# upgrade_account
|
||||||
process_payload
|
# process_payload
|
||||||
head 202
|
head 202
|
||||||
else
|
else
|
||||||
render plain: signature_verification_failure_reason, status: 401
|
render plain: signature_verification_failure_reason, status: 401
|
||||||
|
@ -49,6 +49,6 @@ class ActivityPub::InboxesController < Api::BaseController
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_payload
|
def process_payload
|
||||||
ActivityPub::ProcessingWorker.perform_async(signed_request_account.id, body, @account&.id)
|
# ActivityPub::ProcessingWorker.perform_async(signed_request_account.id, body, @account&.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -108,13 +108,13 @@ class SuspendAccountService < BaseService
|
||||||
end
|
end
|
||||||
|
|
||||||
def distribute_delete_actor!
|
def distribute_delete_actor!
|
||||||
ActivityPub::DeliveryWorker.push_bulk(delivery_inboxes) do |inbox_url|
|
# ActivityPub::DeliveryWorker.push_bulk(delivery_inboxes) do |inbox_url|
|
||||||
[delete_actor_json, @account.id, inbox_url]
|
# [delete_actor_json, @account.id, inbox_url]
|
||||||
end
|
# end
|
||||||
|
|
||||||
ActivityPub::LowPriorityDeliveryWorker.push_bulk(low_priority_delivery_inboxes) do |inbox_url|
|
# ActivityPub::LowPriorityDeliveryWorker.push_bulk(low_priority_delivery_inboxes) do |inbox_url|
|
||||||
[delete_actor_json, @account.id, inbox_url]
|
# [delete_actor_json, @account.id, inbox_url]
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_actor_json
|
def delete_actor_json
|
||||||
|
|
|
@ -6,7 +6,7 @@ class ActivityPub::DeliveryWorker
|
||||||
STOPLIGHT_FAILURE_THRESHOLD = 10
|
STOPLIGHT_FAILURE_THRESHOLD = 10
|
||||||
STOPLIGHT_COOLDOWN = 60
|
STOPLIGHT_COOLDOWN = 60
|
||||||
|
|
||||||
sidekiq_options queue: 'push', retry: 3, dead: false
|
sidekiq_options queue: 'push', retry: 0, dead: true
|
||||||
|
|
||||||
HEADERS = { 'Content-Type' => 'application/activity+json' }.freeze
|
HEADERS = { 'Content-Type' => 'application/activity+json' }.freeze
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class ActivityPub::DistributionWorker
|
class ActivityPub::DistributionWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
|
|
||||||
sidekiq_options queue: 'push'
|
sidekiq_options queue: 'push', retry: 0, dead: true
|
||||||
|
|
||||||
def perform(status_id)
|
def perform(status_id)
|
||||||
@status = Status.find(status_id)
|
@status = Status.find(status_id)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ActivityPub::LowPriorityDeliveryWorker < ActivityPub::DeliveryWorker
|
class ActivityPub::LowPriorityDeliveryWorker < ActivityPub::DeliveryWorker
|
||||||
sidekiq_options queue: 'pull', retry: 3, dead: false
|
sidekiq_options queue: 'pull', retry: 0, dead: true
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
class ActivityPub::ProcessingWorker
|
class ActivityPub::ProcessingWorker
|
||||||
include Sidekiq::Worker
|
include Sidekiq::Worker
|
||||||
|
|
||||||
sidekiq_options backtrace: true, retry: 3
|
sidekiq_options backtrace: true, retry: 0, dead: true
|
||||||
|
|
||||||
def perform(account_id, body, delivered_to_account_id = nil)
|
def perform(account_id, body, delivered_to_account_id = nil)
|
||||||
ActivityPub::ProcessCollectionService.new.call(body, Account.find(account_id), override_timestamps: true, delivered_to_account_id: delivered_to_account_id, delivery: true)
|
ActivityPub::ProcessCollectionService.new.call(body, Account.find(account_id), override_timestamps: true, delivered_to_account_id: delivered_to_account_id, delivery: true)
|
||||||
|
|
|
@ -73,12 +73,12 @@ Rails.application.routes.draw do
|
||||||
resource :follow, only: [:create], controller: :account_follow
|
resource :follow, only: [:create], controller: :account_follow
|
||||||
resource :unfollow, only: [:create], controller: :account_unfollow
|
resource :unfollow, only: [:create], controller: :account_unfollow
|
||||||
|
|
||||||
resource :outbox, only: [:show], module: :activitypub
|
# resource :outbox, only: [:show], module: :activitypub
|
||||||
resource :inbox, only: [:create], module: :activitypub
|
# resource :inbox, only: [:create], module: :activitypub
|
||||||
resources :collections, only: [:show], module: :activitypub
|
# resources :collections, only: [:show], module: :activitypub
|
||||||
end
|
end
|
||||||
|
|
||||||
resource :inbox, only: [:create], module: :activitypub
|
# resource :inbox, only: [:create], module: :activitypub
|
||||||
|
|
||||||
get '/interact/:id', to: 'remote_interaction#new', as: :remote_interaction
|
get '/interact/:id', to: 'remote_interaction#new', as: :remote_interaction
|
||||||
post '/interact/:id', to: 'remote_interaction#create'
|
post '/interact/:id', to: 'remote_interaction#create'
|
||||||
|
|
Loading…
Reference in New Issue