resque-change_queue 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +58 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/resque/change_queue.rb +58 -0
- data/lib/resque/change_queue/server.rb +63 -0
- data/lib/resque/change_queue/server/views/jobs.html.erb +70 -0
- data/lib/resque/change_queue/server/views/search.html.erb +77 -0
- data/lib/resque/change_queue/version.rb +5 -0
- data/resque-change_queue.gemspec +44 -0
- metadata +149 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d7d127b9f55f4c625fe6c7f10a2811aac5ef6d0b
|
4
|
+
data.tar.gz: 58d019ef9c238d2e2584853a0aa0a6c995a12b03
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 88e871ec894e8203ad4b1251bb54bf9307dd7af3827be524aec18d1d76f29c4f0ecdee86ff62e73d7bb90ca2b74d5c7626e0ec9dd75157eaa253eafa5daf9003
|
7
|
+
data.tar.gz: 576377b4f03a53ea5e71baca61ffd59edc89dbf387675d59518e2fa0ae3b4d5d1edc372c473db7585167d51bcb07be55adedad086c88dc24a27df5aab47e571a
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at romain.pechayre@applidget.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 rpechayr
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Resque ChangeQueue
|
2
|
+
[![Build Status](https://travis-ci.org/applidget/resque-change_queue.svg?branch=master)](https://travis-ci.org/applidget/resque-change_queue)
|
3
|
+
|
4
|
+
Resque ChangeQueue is a [Resque](https://github.com/resque/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.
|
5
|
+
|
6
|
+
Jobs can be queried based on their Class name and parameters.
|
7
|
+
|
8
|
+
Requeuing is done in a smart way such that you are 100% sure not to loose any job:
|
9
|
+
- The entire source queue is flushed (using `redis.pop`)
|
10
|
+
- Matched jobs are queued to the target queue directly
|
11
|
+
- Un matched jobs are queued to a temporay queue dedicated to the operation
|
12
|
+
- Finally all jobs in the temporary queue are requeued in the source queue
|
13
|
+
|
14
|
+
## Installation
|
15
|
+
|
16
|
+
Add this line to your application's Gemfile:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
gem 'resque-change_queue'
|
20
|
+
```
|
21
|
+
|
22
|
+
And then execute:
|
23
|
+
|
24
|
+
$ bundle
|
25
|
+
|
26
|
+
Or install it yourself as:
|
27
|
+
|
28
|
+
$ gem install resque-change_queue
|
29
|
+
|
30
|
+
## Usage from the UI
|
31
|
+
|
32
|
+
This plugin is primarly 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.
|
33
|
+
![](https://s3-eu-west-1.amazonaws.com/assets.applidget.com/documentation/change-queue-home.png)
|
34
|
+
|
35
|
+
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]`).
|
36
|
+
|
37
|
+
The next screen show you the first 100 jobs matching your criteria. Just pick a target queue and validate, you're done!
|
38
|
+
|
39
|
+
![](https://s3-eu-west-1.amazonaws.com/assets.applidget.com/documentation/change-queue-jobs.png)
|
40
|
+
|
41
|
+
|
42
|
+
## Usage from code
|
43
|
+
|
44
|
+
You can call Resque ChangeQueue from a console or from code :
|
45
|
+
```ruby
|
46
|
+
Resque::ChangeQueue.change_queue(source_q, target_q, "SomeJobClass", args)
|
47
|
+
```
|
48
|
+
|
49
|
+
*Note*: `args` is an optional parameter.
|
50
|
+
|
51
|
+
## Contributing
|
52
|
+
|
53
|
+
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](http://contributor-covenant.org) code of conduct.
|
54
|
+
|
55
|
+
|
56
|
+
## License
|
57
|
+
|
58
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "resque/change_queue"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require "resque/change_queue/version"
|
2
|
+
require "resque"
|
3
|
+
require 'resque/server'
|
4
|
+
|
5
|
+
module Resque
|
6
|
+
module ChangeQueue
|
7
|
+
module_function
|
8
|
+
def change_queue(from_queue, to_queue, klass, args = [])
|
9
|
+
tmp_queue = "operation:#{SecureRandom.uuid}"
|
10
|
+
moved_count = 0
|
11
|
+
while job = Resque.pop(from_queue)
|
12
|
+
target_queue = tmp_queue
|
13
|
+
if job["class"] == klass.to_s && match_args(job["args"], args)
|
14
|
+
target_queue = to_queue
|
15
|
+
moved_count += 1
|
16
|
+
end
|
17
|
+
Resque.push(target_queue, job)
|
18
|
+
end
|
19
|
+
|
20
|
+
while job = Resque.pop(tmp_queue)
|
21
|
+
Resque.push(from_queue, job)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Finally ensure queue is removed
|
25
|
+
Resque.remove_queue(tmp_queue)
|
26
|
+
moved_count
|
27
|
+
end
|
28
|
+
|
29
|
+
def search_jobs(queue, klass, args = [], start = 0, count = 100)
|
30
|
+
matched_jobs = []
|
31
|
+
has_next = true
|
32
|
+
while has_next
|
33
|
+
page = Resque.peek(queue, start, 100)
|
34
|
+
page.each do |job|
|
35
|
+
next unless job["class"] == klass.to_s
|
36
|
+
matched_jobs << job if match_args(job["args"], args)
|
37
|
+
break if matched_jobs.count >= count
|
38
|
+
end
|
39
|
+
break if matched_jobs.count >= count
|
40
|
+
has_next = (page != nil && page.count == 100)
|
41
|
+
start += 100
|
42
|
+
end
|
43
|
+
matched_jobs
|
44
|
+
end
|
45
|
+
|
46
|
+
def match_args(job_args, criteria_args)
|
47
|
+
match = true
|
48
|
+
criteria_args.each_with_index do |item, index|
|
49
|
+
next if item.nil?
|
50
|
+
if job_args[index] != item
|
51
|
+
match = false
|
52
|
+
break
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
require 'resque/change_queue/server'
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
# Extends Resque Web Based UI.
|
4
|
+
# Structure has been borrowed from ResqueCleaner.
|
5
|
+
module Resque
|
6
|
+
module ChangeQueue
|
7
|
+
module Server
|
8
|
+
|
9
|
+
def self.erb_path(filename)
|
10
|
+
File.join(File.dirname(__FILE__), 'server', 'views', filename)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.public_path(filename)
|
14
|
+
File.join(File.dirname(__FILE__), 'server', 'public', filename)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.included(base)
|
18
|
+
|
19
|
+
base.class_eval do
|
20
|
+
get "/changequeue" do
|
21
|
+
erb File.read(Resque::ChangeQueue::Server.erb_path('search.html.erb'))
|
22
|
+
end
|
23
|
+
|
24
|
+
get "/changequeue/jobs" do
|
25
|
+
klassname = params[:classname]
|
26
|
+
|
27
|
+
#Process args to remove all tailing blank ones
|
28
|
+
args_hash = params[:args] || {}
|
29
|
+
args = args_hash.values.reverse
|
30
|
+
while args.count > 0 && args[0].try(:length) == 0
|
31
|
+
args.shift
|
32
|
+
end
|
33
|
+
args = args.reverse!
|
34
|
+
jobs = Resque::ChangeQueue.search_jobs(params[:queue], klassname, args)
|
35
|
+
tpl_params = {
|
36
|
+
jobs: jobs,
|
37
|
+
classname: klassname,
|
38
|
+
source_queue: params[:queue],
|
39
|
+
args: Base64.encode64(args.to_json)
|
40
|
+
}
|
41
|
+
erb File.read(Resque::ChangeQueue::Server.erb_path('jobs.html.erb')),{}, tpl_params
|
42
|
+
end
|
43
|
+
|
44
|
+
post "/changequeue/move_jobs" do
|
45
|
+
args = JSON.parse(Base64.decode64(params["b64_args"]))
|
46
|
+
results = Resque::ChangeQueue.change_queue(params[:source_queue], params[:queue], params[:classname], args)
|
47
|
+
|
48
|
+
#FIXME if resque mounted somewhere else the redirection won't work ..
|
49
|
+
#TODO: Display some kind of notice to next page
|
50
|
+
redirect "/resque/changequeue", 302
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
Resque::Server.tabs << 'ChangeQueue'
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
Resque::Server.class_eval do
|
62
|
+
include Resque::ChangeQueue::Server
|
63
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<style scoped>
|
2
|
+
#main .change-queue form {
|
3
|
+
/* resets */
|
4
|
+
float:none;
|
5
|
+
margin-top:20px;
|
6
|
+
margin-left: 0px;
|
7
|
+
}
|
8
|
+
#main .change-queue label {
|
9
|
+
float:none;
|
10
|
+
display: block;
|
11
|
+
max-width: 100%;
|
12
|
+
margin-bottom: 5px;
|
13
|
+
font-weight: 700;
|
14
|
+
}
|
15
|
+
|
16
|
+
#main .change-queue .form-group {
|
17
|
+
margin-bottom: 15px;
|
18
|
+
}
|
19
|
+
|
20
|
+
#main .change-queue .form-control {
|
21
|
+
display: block;
|
22
|
+
}
|
23
|
+
|
24
|
+
#main .change-queue .args .form-group {
|
25
|
+
margin-bottom:8px;
|
26
|
+
}
|
27
|
+
|
28
|
+
</style>
|
29
|
+
|
30
|
+
<table class='jobs'>
|
31
|
+
<p>
|
32
|
+
<%= jobs.count == 100 ? "100+" : jobs.count %> jobs with your criteria in this queue
|
33
|
+
</p>
|
34
|
+
<div class="change-queue">
|
35
|
+
<form method="POST" action="<%= url_path "/changequeue/move_jobs"%>" >
|
36
|
+
<div class="form-group">
|
37
|
+
<label for="queue">Move to queue</label>
|
38
|
+
<select class="form-control" name="queue">
|
39
|
+
<% Resque.queues.each do |q| %>
|
40
|
+
<option <%= q == source_queue ? "disabled": ""%>><%= q %></option>
|
41
|
+
<% end %>
|
42
|
+
</select>
|
43
|
+
<div style="display:none">
|
44
|
+
<input name="classname" value="<%= classname %>">
|
45
|
+
<input name="source_queue" value="<%= source_queue %>">
|
46
|
+
<input name="b64_args" value="<%= args %>">
|
47
|
+
</div>
|
48
|
+
</div>
|
49
|
+
|
50
|
+
<div class="form-group">
|
51
|
+
<input type="submit" value="Move jobs !">
|
52
|
+
</div>
|
53
|
+
</form>
|
54
|
+
</div>
|
55
|
+
<tr>
|
56
|
+
<th>Class</th>
|
57
|
+
<th>Args</th>
|
58
|
+
</tr>
|
59
|
+
<% for job in jobs %>
|
60
|
+
<tr>
|
61
|
+
<td class='class'><%= job['class'] %></td>
|
62
|
+
<td class='args'><%=h job['args'].inspect %></td>
|
63
|
+
</tr>
|
64
|
+
<% end %>
|
65
|
+
<% if jobs.empty? %>
|
66
|
+
<tr>
|
67
|
+
<td class='no-data' colspan='2'>There are no pending job with these criteria</td>
|
68
|
+
</tr>
|
69
|
+
<% end %>
|
70
|
+
</table>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
<style scoped>
|
2
|
+
#main .change-queue form {
|
3
|
+
/* resets */
|
4
|
+
float:none;
|
5
|
+
margin-top:20px;
|
6
|
+
margin-left: 0px;
|
7
|
+
}
|
8
|
+
#main .change-queue label {
|
9
|
+
float:none;
|
10
|
+
display: block;
|
11
|
+
max-width: 100%;
|
12
|
+
margin-bottom: 5px;
|
13
|
+
font-weight: 700;
|
14
|
+
}
|
15
|
+
|
16
|
+
#main .change-queue .form-group {
|
17
|
+
margin-bottom: 15px;
|
18
|
+
}
|
19
|
+
|
20
|
+
#main .change-queue .form-control {
|
21
|
+
display: block;
|
22
|
+
}
|
23
|
+
|
24
|
+
#main .change-queue .args .form-group {
|
25
|
+
margin-bottom:8px;
|
26
|
+
}
|
27
|
+
|
28
|
+
</style>
|
29
|
+
<script type="text/javascript">
|
30
|
+
(function($) {
|
31
|
+
$(document).ready(function(){
|
32
|
+
$(".args input").live("keyup", function(e) {
|
33
|
+
var currentNumber = $(".args input").length;
|
34
|
+
var target = e.target;
|
35
|
+
var lastElementName = "args[" + (currentNumber - 1) + "]";
|
36
|
+
//Is is the last element ? Is there any content then ?
|
37
|
+
if (target.name == lastElementName && target.value.length > 0) {
|
38
|
+
var newEl = '<div class="form-group"><input autocomplete="off" type="input" class="form-control" name="args[' + currentNumber + ']" placeholder="argument ' + (currentNumber + 1) +'"></input></div>';
|
39
|
+
$(".args").append(newEl);
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
})(jQuery);
|
44
|
+
|
45
|
+
</script>
|
46
|
+
<div class="title clearfix">
|
47
|
+
<h1>Change queue</h1>
|
48
|
+
</div>
|
49
|
+
<p>
|
50
|
+
You can query jobs on a certain queue based on their class name and args in order to requeue them into another one.
|
51
|
+
</p>
|
52
|
+
<div class="change-queue">
|
53
|
+
<form method="GET" action="<%= url_path "/changequeue/jobs"%>" >
|
54
|
+
<div class="form-group">
|
55
|
+
<label for="queue">Queue</label>
|
56
|
+
<select class="form-control" name="queue">
|
57
|
+
<% Resque.queues.each do |q| %>
|
58
|
+
<option><%= q %></option>
|
59
|
+
<% end %>
|
60
|
+
</select>
|
61
|
+
</div>
|
62
|
+
<div class="form-group">
|
63
|
+
<label for="classname">Class name</label>
|
64
|
+
<input type="input" autocomplete="off" class="form-control" name="classname" value="">
|
65
|
+
</div>
|
66
|
+
<div class="args">
|
67
|
+
<div class="form-group">
|
68
|
+
<label for="args[0]">Arguments</label>
|
69
|
+
<input type="input" autocomplete="off" class="form-control" name="args[0]" placeholder="argument 1">
|
70
|
+
</div>
|
71
|
+
</div>
|
72
|
+
|
73
|
+
<div class="form-group">
|
74
|
+
<input type="submit" value="Show jobs and then requeue ...">
|
75
|
+
</div>
|
76
|
+
</form>
|
77
|
+
</div>
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'resque/change_queue/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "resque-change_queue"
|
8
|
+
spec.version = Resque::ChangeQueue::VERSION
|
9
|
+
spec.authors = ["rpechayr"]
|
10
|
+
spec.email = ["romain.pechayre@applidget.com"]
|
11
|
+
spec.homepage = "https://github.com/applidget/resque-change_queue"
|
12
|
+
spec.summary = 'Reorganize queued jobs on the fly'
|
13
|
+
spec.description = <<-DESCRIPTION
|
14
|
+
Allows you to requeue jobs to another queue
|
15
|
+
This is useful in my situations :
|
16
|
+
- A large amount of jobs are queued in the critical queue, blocking the main queue for Several hours.
|
17
|
+
Select jobs based on criteria and requeue them to the low queue
|
18
|
+
DESCRIPTION
|
19
|
+
spec.license = "MIT"
|
20
|
+
|
21
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
22
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
23
|
+
if spec.respond_to?(:metadata)
|
24
|
+
spec.metadata['allowed_push_host'] = "https://rubygems.org"
|
25
|
+
else
|
26
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
27
|
+
"public gem pushes."
|
28
|
+
end
|
29
|
+
|
30
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
31
|
+
f.match(%r{^(test|spec|features)/})
|
32
|
+
end
|
33
|
+
spec.bindir = "exe"
|
34
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
|
+
spec.require_paths = ["lib"]
|
36
|
+
|
37
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
38
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
39
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
40
|
+
spec.add_development_dependency "byebug", "~> 9.0"
|
41
|
+
|
42
|
+
spec.add_runtime_dependency 'redis', '~> 3.0'
|
43
|
+
spec.add_runtime_dependency 'resque', '~> 1.25'
|
44
|
+
end
|
metadata
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: resque-change_queue
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- rpechayr
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-11-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.13'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.13'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: byebug
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '9.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '9.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: redis
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: resque
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.25'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.25'
|
97
|
+
description: |2
|
98
|
+
Allows you to requeue jobs to another queue
|
99
|
+
This is useful in my situations :
|
100
|
+
- A large amount of jobs are queued in the critical queue, blocking the main queue for Several hours.
|
101
|
+
Select jobs based on criteria and requeue them to the low queue
|
102
|
+
email:
|
103
|
+
- romain.pechayre@applidget.com
|
104
|
+
executables: []
|
105
|
+
extensions: []
|
106
|
+
extra_rdoc_files: []
|
107
|
+
files:
|
108
|
+
- ".gitignore"
|
109
|
+
- ".rspec"
|
110
|
+
- ".travis.yml"
|
111
|
+
- CODE_OF_CONDUCT.md
|
112
|
+
- Gemfile
|
113
|
+
- LICENSE.txt
|
114
|
+
- README.md
|
115
|
+
- Rakefile
|
116
|
+
- bin/console
|
117
|
+
- bin/setup
|
118
|
+
- lib/resque/change_queue.rb
|
119
|
+
- lib/resque/change_queue/server.rb
|
120
|
+
- lib/resque/change_queue/server/views/jobs.html.erb
|
121
|
+
- lib/resque/change_queue/server/views/search.html.erb
|
122
|
+
- lib/resque/change_queue/version.rb
|
123
|
+
- resque-change_queue.gemspec
|
124
|
+
homepage: https://github.com/applidget/resque-change_queue
|
125
|
+
licenses:
|
126
|
+
- MIT
|
127
|
+
metadata:
|
128
|
+
allowed_push_host: https://rubygems.org
|
129
|
+
post_install_message:
|
130
|
+
rdoc_options: []
|
131
|
+
require_paths:
|
132
|
+
- lib
|
133
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: '0'
|
143
|
+
requirements: []
|
144
|
+
rubyforge_project:
|
145
|
+
rubygems_version: 2.4.5.1
|
146
|
+
signing_key:
|
147
|
+
specification_version: 4
|
148
|
+
summary: Reorganize queued jobs on the fly
|
149
|
+
test_files: []
|