Low commit activity in last 3 years
No release in over a year
Allows you to requeue jobs to another queue This is useful in my situations : - A large amount of jobs are queued in the critical queue, blocking the main queue for Several hours. Select jobs based on criteria and requeue them to the low queue
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 9.0
~> 10.0
~> 3.0
>= 1.13

Runtime

>= 1.25, < 3
 Project Readme

Resque ChangeQueue

example workflow

Resque ChangeQueue is a Resque plugin allowing you to move jobs from one queue to another. This can be useful in some situation where some queue can be unexpectedly filled with thousands of slow jobs to isolate them in a low queue in order not to block normal jobs.

Jobs can be queried based on their Class name and parameters.

Requeuing is done in a smart way such that you are 100% sure not to loose any job:

  • The entire source queue is flushed (using redis.pop)
  • Matched jobs are queued to the target queue directly
  • Un matched jobs are queued to a temporay queue dedicated to the operation
  • Finally all jobs in the temporary queue are requeued in the source queue

Installation

Add this line to your application's Gemfile:

gem 'resque-change_queue'

And then execute:

$ bundle

Or install it yourself as:

$ gem install resque-change_queue

Usage from the UI

This plugin is primarily built to enable manual jobs manipulation from resque web interface (native resque 1.x sinatra web interface). When including the gem into your Gemfile, you'll create a new tab in resque UI. You can filter the jobs from here, and then validate.

You can add as many args in this step, and jobs will be matched based on strict equality of each parameter. If you specify less parameters than the number of parameters in the target jobs, additional parameters will be considered as matching. This allows you to filter jobs assuming that the first arguments are top level object ids (for example if your args are [project_id, discussion_id, comment_id]).

The next screen show you the first 100 jobs matching your criteria. Just pick a target queue and validate, you're done!

Usage from code

You can call Resque ChangeQueue from a console or from code :

Resque::ChangeQueue.change_queue(source_q, target_q, "SomeJobClass", args)

Note: args is an optional parameter.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/applidget/resque-change_queue. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.