resque 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of resque might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b930a952313756e06d51bb6daa493ebeed0c4498940e46d24300f7fafdac36b3
4
- data.tar.gz: ea821158f150dbf5740dff8cb210be0f7507c1e183acd3a902308f0ef91e7f2c
3
+ metadata.gz: b6f395169f58a51122135f8cbf6495ca914a472a94038277d6d022ac1387459a
4
+ data.tar.gz: ba5b39c8521b48b0f882c2290d105dc8b2db24308cf08d14d630841ed45585ed
5
5
  SHA512:
6
- metadata.gz: d266f8019b93add5de76d0d3e5a460c2a03c3fc04b3d71c65f296269c7e286875b6b1925d31d01699c952d14319164cab39062f9310314fed0b4229b92f47821
7
- data.tar.gz: d375348987a655202483adb5eccb253ed07eea17d88749c04837e0ec05dad948805cb371500ac42b11650595327875f0af56e9c3501261e8223f6c1fbfff5f5f
6
+ metadata.gz: f03920bbf92a185a5d6c062d9d10dbc17c8b3090ed9bbd04138e85b3a40f0cefa377c21f22a343c3c9b64cd3502998efa5b42f5a6f6c7f314712ceb54bc9671e
7
+ data.tar.gz: af2ac4eb41bd9dc30951fd1122deada0b445000736ff08a020313e4337655c61e79af888e7b21e3c6c1cacab2e3bc5cc1f4d28577d2e2e02e62c5f8bf3452a18
data/HISTORY.md CHANGED
@@ -1,15 +1,27 @@
1
1
  ## Unreleased
2
2
 
3
- ### Added
3
+ ### Fixed
4
4
 
5
5
  *
6
6
  *
7
7
 
8
- ### Fixed
8
+ ### Added
9
9
 
10
10
  *
11
11
  *
12
12
 
13
+ ## 2.2.0
14
+
15
+ ### Added
16
+
17
+ * Add 'Retry Failed Jobs' button to Failed page
18
+
19
+ ### Fixed
20
+
21
+ * Loading railtie when it did not exist #1765
22
+ * Fix closing parent Redis connection in child process after fork
23
+ * Fix the failed queues list on /queues UI when the RedisMultiQueue backend is used #1638
24
+
13
25
  ## 2.1.0
14
26
 
15
27
  ### Security
@@ -76,9 +76,10 @@ module Resque
76
76
  @redis.inspect
77
77
  end
78
78
 
79
- # Force a reconnect to Redis.
79
+ # Force a reconnect to Redis without closing the connection in the parent
80
+ # process after a fork.
80
81
  def reconnect
81
- @redis._client.reconnect
82
+ @redis._client.connect
82
83
  end
83
84
 
84
85
  # Returns an array of all known Resque keys in Redis. Redis' KEYS operation
@@ -91,6 +91,12 @@ module Resque
91
91
  backend.clear(queue)
92
92
  end
93
93
 
94
+ def self.clear_retried
95
+ each do |index, job|
96
+ remove(index) unless job['retried_at'].nil?
97
+ end
98
+ end
99
+
94
100
  def self.requeue(id, queue = nil)
95
101
  backend.requeue(id, queue)
96
102
  end
@@ -9,7 +9,9 @@ Resque::Server.helpers do
9
9
 
10
10
  def failed_multiple_queues?
11
11
  return @multiple_failed_queues if defined?(@multiple_failed_queues)
12
- @multiple_failed_queues = Resque::Failure.queues.size > 1
12
+
13
+ @multiple_failed_queues = Resque::Failure.queues.size > 1 ||
14
+ (defined?(Resque::Failure::RedisMultiQueue) && Resque::Failure.backend == Resque::Failure::RedisMultiQueue)
13
15
  end
14
16
 
15
17
  def failed_size
@@ -8,6 +8,12 @@
8
8
  <form method="POST" action="<%= u "failed#{'/' + params[:queue] if params[:queue]}/clear" %>">
9
9
  <input type="submit" name="" value="Clear <%= params[:queue] ? "'#{params[:queue]}'" : 'Failed' %> Jobs" class="confirmSubmission" />
10
10
  </form>
11
+
12
+ <% unless params[:queue] %>
13
+ <form method="POST" action="<%= u "failed/clear_retried" %>">
14
+ <input type="submit" name="" value="Clear Retried Jobs" onclick='return confirm("Are you absolutely sure? This cannot be undone.");' />
15
+ </form>
16
+ <% end %>
11
17
  <form method="POST" action="<%= u "failed#{'/' + params[:queue] if params[:queue]}/requeue/all" %>">
12
18
  <input type="submit" name="" value="Retry <%= params[:queue] ? "'#{params[:queue]}'" : 'Failed' %> Jobs" class="confirmSubmission" />
13
19
  </form>
@@ -37,7 +37,7 @@
37
37
  </div>
38
38
 
39
39
  <div id="footer">
40
- <p>Powered by <a href="http://github.com/resque/resque">Resque</a> v<%=Resque::Version%></p>
40
+ <p>Powered by <a href="http://github.com/resque/resque">Resque</a> v<%=Resque::VERSION%></p>
41
41
  <p>Connected to Redis namespace <%= Resque.redis.namespace %> on <%=Resque.redis_id%></p>
42
42
  </div>
43
43
 
data/lib/resque/server.rb CHANGED
@@ -205,6 +205,11 @@ module Resque
205
205
  redirect u('failed')
206
206
  end
207
207
 
208
+ post "/failed/clear_retried" do
209
+ Resque::Failure.clear_retried
210
+ redirect u('failed')
211
+ end
212
+
208
213
  post "/failed/:queue/clear" do
209
214
  Resque::Failure.clear params[:queue]
210
215
  redirect u('failed')
@@ -1,3 +1,3 @@
1
1
  module Resque
2
- Version = VERSION = '2.1.0'
2
+ VERSION = '2.2.0'
3
3
  end
data/lib/resque/worker.rb CHANGED
@@ -852,7 +852,7 @@ module Resque
852
852
  `ps -A -o pid,comm | grep "[r]uby" | grep -v "resque-web"`.split("\n").map do |line|
853
853
  real_pid = line.split(' ')[0]
854
854
  pargs_command = `pargs -a #{real_pid} 2>/dev/null | grep [r]esque | grep -v "resque-web"`
855
- if pargs_command.split(':')[1] == " resque-#{Resque::Version}"
855
+ if pargs_command.split(':')[1] == " resque-#{Resque::VERSION}"
856
856
  real_pid
857
857
  end
858
858
  end.compact
@@ -862,7 +862,7 @@ module Resque
862
862
  # Procline is always in the format of:
863
863
  # RESQUE_PROCLINE_PREFIXresque-VERSION: STRING
864
864
  def procline(string)
865
- $0 = "#{ENV['RESQUE_PROCLINE_PREFIX']}resque-#{Resque::Version}: #{string}"
865
+ $0 = "#{ENV['RESQUE_PROCLINE_PREFIX']}resque-#{Resque::VERSION}: #{string}"
866
866
  log_with_severity :debug, $0
867
867
  end
868
868
 
data/lib/resque.rb CHANGED
@@ -23,7 +23,7 @@ require 'resque/thread_signal'
23
23
 
24
24
  require 'resque/vendor/utf8_util'
25
25
 
26
- require 'resque/railtie' if defined?(Rails)
26
+ require 'resque/railtie' if defined?(Rails::Railtie)
27
27
 
28
28
  module Resque
29
29
  include Helpers
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
8
8
  - Steve Klabnik
9
9
  - Terence Lee
10
+ - Michael Bianco
10
11
  autorequire:
11
12
  bindir: bin
12
13
  cert_chain: []
13
- date: 2021-08-10 00:00:00.000000000 Z
14
+ date: 2021-11-04 00:00:00.000000000 Z
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: redis-namespace
@@ -165,10 +166,11 @@ files:
165
166
  - lib/resque/worker.rb
166
167
  - lib/tasks/redis.rake
167
168
  - lib/tasks/resque.rake
168
- homepage: http://resque.github.io/
169
+ homepage: https://github.com/resque/resque
169
170
  licenses:
170
171
  - MIT
171
- metadata: {}
172
+ metadata:
173
+ changelog_uri: https://github.com/resque/resque/blob/master/HISTORY.md
172
174
  post_install_message:
173
175
  rdoc_options:
174
176
  - "--charset=UTF-8"