Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

low_delivery queue v2 #30150

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/workers/activitypub/low_priority_delivery_worker.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

class ActivityPub::LowPriorityDeliveryWorker < ActivityPub::DeliveryWorker
sidekiq_options queue: 'pull', retry: 8, dead: false
sidekiq_options queue: 'low_delivery', retry: 8, dead: false
shleeable marked this conversation as resolved.
Show resolved Hide resolved
end
4 changes: 2 additions & 2 deletions app/workers/scheduler/suspended_user_cleanup_scheduler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Scheduler::SuspendedUserCleanupScheduler
# Each processed deletion request may enqueue an enormous
# amount of jobs in the `pull` queue, so only enqueue when
# the queue is empty or close to being so.
MAX_PULL_SIZE = 50
MAX_QUEUE_SIZE = 50

# Since account deletion is very expensive, we want to avoid
# overloading the server by queuing too much at once.
Expand All @@ -19,7 +19,7 @@ class Scheduler::SuspendedUserCleanupScheduler
sidekiq_options retry: 0, lock: :until_executed, lock_ttl: 1.day.to_i

def perform
return if Sidekiq::Queue.new('pull').size > MAX_PULL_SIZE
return if Sidekiq::Queue.new('low_delivery').size > MAX_QUEUE_SIZE

process_deletion_requests!
end
Expand Down
5 changes: 3 additions & 2 deletions config/sidekiq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
- [default, 8]
- [push, 6]
- [ingress, 4]
- [mailers, 2]
- [pull]
- [mailers, 3]
- [pull, 2]
- [low_delivery]
- [scheduler]

:scheduler:
Expand Down