Add deduplication for JSON payloads in job queue

This commit is contained in:
Eugen Rochko 2022-10-25 01:07:00 +02:00
parent 30453fab80
commit 1bfbfb0317
8 changed files with 163 additions and 2 deletions

View file

@ -8,7 +8,7 @@ class ActivityPub::DeliveryWorker
STOPLIGHT_FAILURE_THRESHOLD = 10
STOPLIGHT_COOLDOWN = 60
sidekiq_options queue: 'push', retry: 16, dead: false
sidekiq_options queue: 'push', retry: 16, dead: false, deduplicate_arguments: 0
HEADERS = { 'Content-Type' => 'application/activity+json' }.freeze

View file

@ -3,7 +3,7 @@
class ActivityPub::ProcessingWorker
include Sidekiq::Worker
sidekiq_options backtrace: true, retry: 8
sidekiq_options backtrace: true, retry: 8, deduplicate_arguments: 1
def perform(actor_id, body, delivered_to_account_id = nil, actor_type = 'Account')
case actor_type