You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ruby version: 3.2.2
Rails version: 7.0.4.2
Sidekiq / Pro / Enterprise version(s): No
In the testing guide, section Queue API, there is this guide to clear the queue:
# Clear an individual queue
Sidekiq::Queues["other"].clear
However, if we look at the implementation, following the guide will lead to only jobs_by_queue being cleared, not jobs_by_class, so when we query the queue using class style (SomeJob.jobs), the job is still there. I find this behavior very surprising.
The text was updated successfully, but these errors were encountered:
tiendo1011
changed the title
Sidekiq::Queues[queue_name].clear causes bug
Sidekiq::Queues[queue_name].clear causes surprising behavior
Oct 13, 2023
Ruby version: 3.2.2
Rails version: 7.0.4.2
Sidekiq / Pro / Enterprise version(s): No
In the testing guide, section Queue API, there is this guide to clear the queue:
However, if we look at the implementation, following the guide will lead to only
jobs_by_queue
being cleared, notjobs_by_class
, so when we query the queue using class style (SomeJob.jobs), the job is still there. I find this behavior very surprising.The text was updated successfully, but these errors were encountered: