veeqo / activejob-uniqueness

Unique jobs for ActiveJob. Ensure the uniqueness of jobs in the queue.
https://devs.veeqo.com/job-uniqueness-for-activejob/
MIT License
265 stars 27 forks source link

Clear a queue #60

Open nhorton opened 1 year ago

nhorton commented 1 year ago

We are really struggling with queue clearing, particularly if queues have gotten big. Usually when it happens, we don't care about the locks because they have timed out.

Our current plan is to just copy the base sidekiq code for clearing a queue and monkey-patching it back into Sidekiq next to the normal clear code that has been modified by the patch (which we want in other cases), and then just call that. I am posting for two reasons:

  1. This feels like a common-enough need that it might make sense to modify this gem to rename the base clear method and leave it there so that others can do this without patching
  2. Confirm if you see other gotchas.

Thanks for the great gem!