```ruby
desc 'Clear all Sidekiq queues'
task clear_sidekiq: :environment do
  sets = [
    Sidekiq::Queue,
    Sidekiq::ScheduledSet,
    Sidekiq::RetrySet,
    Sidekiq::DeadSet
  ]

  sets.each do |set|
    puts set
    puts set.new.clear
  end
end
```

Improve task to clear Sidekiq
user
```ruby
desc 'Clear all Sidekiq queues'
task clear_sidekiq: :environment do
  queues = Sidekiq::Queue.all

  named_queues = [
    Sidekiq::ScheduledSet.new,
    Sidekiq::RetrySet.new,
    Sidekiq::DeadSet.new
  ]

  [queues + named_queues].each do |queue|
    puts queue
    puts queue.clear
  end
end
```
assistant