Class: ClearSidekiqAliveWorker

Inherits:
ApplicationWorker show all
Defined in:
app/workers/clear_sidekiq_alive_worker.rb

Overview

typed: ignore

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#performObject



3
4
5
6
7
8
9
# File 'app/workers/clear_sidekiq_alive_worker.rb', line 3

def perform
  Sidekiq::Queue
    .all
    .select { |q| q.name =~ /^sidekiq_alive-/ }
    .select { |q| q.any? { |w| w.created_at < 1.day.ago } }
    .each(&:clear)
end