Class: Sidekiq::Routing::Auto::RerouteJob

Inherits:
Object
  • Object
show all
Includes:
Job
Defined in:
lib/sidekiq/routing/auto/reroute_job.rb

Overview

Periodic worker that drives latency-based rerouting: for each SLA queue breaching its capacity threshold, move (noisy-neighbor) jobs to the next tier. Schedule it via sidekiq-cron in the host app’s scheduled_jobs.yml.

Plain Sidekiq::Job (no app base class) so the gem carries no dependency on the host’s job hierarchy.

Instance Method Summary collapse

Instance Method Details

#performObject



18
19
20
21
22
23
24
# File 'lib/sidekiq/routing/auto/reroute_job.rb', line 18

def perform
  return unless Sidekiq::Routing::Auto.enabled?

  Sidekiq::Routing::Auto::Router.sla_queues.each do |queue_name|
    process_queue(queue_name)
  end
end