resque 1.24.0 → 1.24.1

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.

@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 38e90902e4b978a24840fc539e704cb215f5dd2a
4
+ data.tar.gz: 26a7b965a985bc1081301509ec15d2ef73212638
5
+ SHA512:
6
+ metadata.gz: 22860bfff69fb573382a48b1a77d5bf7b8f180f4d3ac03096e5a70272cc467c9d9c5f4b764ebf5d22b91c38933f63d1afd2cf98fd3cdf029b7d30c43e97130eb
7
+ data.tar.gz: abf28fbbc53bd5f02ee78aa954b87b8c00f32f3c75bdd7e79d977120071975125630038274ea166f2ab0304de94caa8d454f68c3d294a5d932a44c9e59021bc9
data/HISTORY.md CHANGED
@@ -1,6 +1,9 @@
1
- ## unreleased
1
+ ## 1.24.1 (2013-3-23)
2
2
 
3
- * No changes.
3
+ * Adds a default value for `per_page` on resque-server for plugins which add tabs (@jonhyman)
4
+ * Fix bad logic on the failed queue adapter
5
+ * Added missing `require 'time'` which was causing occasional errors which
6
+ would crash workers.
4
7
 
5
8
  ## 1.24.0 (2013-3-21)
6
9
 
@@ -18,7 +18,7 @@ module Resque
18
18
  end
19
19
 
20
20
  def self.count(queue = nil, class_name = nil)
21
- raise ArgumentError, "invalid queue: #{queue}" if queue && queue.to_s != "failed"
21
+ check_queue(queue)
22
22
 
23
23
  if class_name
24
24
  n = 0
@@ -34,7 +34,7 @@ module Resque
34
34
  end
35
35
 
36
36
  def self.all(offset = 0, limit = 1, queue = nil)
37
- raise ArgumentError, "invalid queue: #{queue}" if queue && queue.to_s == "failed"
37
+ check_queue(queue)
38
38
  Resque.list_range(:failed, offset, limit)
39
39
  end
40
40
 
@@ -47,7 +47,7 @@ module Resque
47
47
  end
48
48
 
49
49
  def self.clear(queue = nil)
50
- raise ArgumentError, "invalid queue: #{queue}" if queue && queue.to_s == "failed"
50
+ check_queue(queue)
51
51
  Resque.redis.del(:failed)
52
52
  end
53
53
 
@@ -84,6 +84,10 @@ module Resque
84
84
  end
85
85
  end
86
86
 
87
+ def self.check_queue(queue)
88
+ raise ArgumentError, "invalid queue: #{queue}" if queue && queue.to_s != "failed"
89
+ end
90
+
87
91
  def filter_backtrace(backtrace)
88
92
  index = backtrace.index { |item| item.include?('/lib/resque/job.rb') }
89
93
  backtrace.first(index.to_i)
@@ -1,3 +1,6 @@
1
+ <% # per_page was added in 1.23.1; gems which add to resque-server don't pass that variable along so it would crash %>
2
+ <% # without a default value %>
3
+ <% per_page ||= 20 %>
1
4
  <%if start - per_page >= 0 || start + per_page <= size%>
2
5
  <p class='pagination'>
3
6
  <% if start - per_page >= 0 %>
@@ -1,3 +1,3 @@
1
1
  module Resque
2
- Version = VERSION = '1.24.0'
2
+ Version = VERSION = '1.24.1'
3
3
  end
@@ -1,3 +1,5 @@
1
+ require 'time'
2
+
1
3
  module Resque
2
4
  # A Resque Worker processes jobs. On platforms that support fork(2),
3
5
  # the worker will fork off a child to process each job. This ensures
@@ -223,7 +225,7 @@ module Resque
223
225
  log e.backtrace.join("\n")
224
226
  raise e
225
227
  end
226
-
228
+
227
229
  # Reconnect to Redis to avoid sharing a connection with the parent,
228
230
  # retry up to 3 times with increasing delay before giving up.
229
231
  def reconnect
@@ -534,7 +536,7 @@ module Resque
534
536
  def idle?
535
537
  state == :idle
536
538
  end
537
-
539
+
538
540
  def will_fork?
539
541
  !@cant_fork && !$TESTING && (ENV["FORK_PER_JOB"] != 'false')
540
542
  end
@@ -627,7 +629,7 @@ module Resque
627
629
  def log!(message)
628
630
  debug(message)
629
631
  end
630
-
632
+
631
633
  # Deprecated legacy methods for controlling the logging threshhold
632
634
  # Use Resque.logger.level now, e.g.:
633
635
  #
@@ -2,7 +2,6 @@ require 'rubygems'
2
2
  require 'bundler/setup'
3
3
  require 'minitest/autorun'
4
4
  require 'redis/namespace'
5
- require 'mocha/setup'
6
5
 
7
6
  $dir = File.dirname(File.expand_path(__FILE__))
8
7
  $LOAD_PATH.unshift $dir + '/../lib'
metadata CHANGED
@@ -1,112 +1,110 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: resque
3
- version: !ruby/object:Gem::Version
4
- hash: 119
5
- prerelease:
6
- segments:
7
- - 1
8
- - 24
9
- - 0
10
- version: 1.24.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.24.1
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Chris Wanstrath
14
8
  - Terence Lee
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2013-03-21 00:00:00 -04:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
23
15
  name: redis-namespace
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
28
18
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 11
31
- segments:
32
- - 1
33
- - 2
34
- version: "1.2"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.2'
35
21
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: vegas
39
22
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
43
25
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 31
46
- segments:
47
- - 0
48
- - 1
49
- - 2
26
+ - !ruby/object:Gem::Version
27
+ version: '1.2'
28
+ - !ruby/object:Gem::Dependency
29
+ name: vegas
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
50
34
  version: 0.1.2
51
35
  type: :runtime
52
- version_requirements: *id002
53
- - !ruby/object:Gem::Dependency
54
- name: sinatra
55
36
  prerelease: false
56
- requirement: &id003 !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- hash: 63
62
- segments:
63
- - 0
64
- - 9
65
- - 2
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: 0.1.2
42
+ - !ruby/object:Gem::Dependency
43
+ name: sinatra
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
66
48
  version: 0.9.2
67
49
  type: :runtime
68
- version_requirements: *id003
69
- - !ruby/object:Gem::Dependency
70
- name: multi_json
71
50
  prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: 0.9.2
56
+ - !ruby/object:Gem::Dependency
57
+ name: multi_json
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
75
60
  - - ~>
76
- - !ruby/object:Gem::Version
77
- hash: 15
78
- segments:
79
- - 1
80
- - 0
81
- version: "1.0"
61
+ - !ruby/object:Gem::Version
62
+ version: '1.0'
82
63
  type: :runtime
83
- version_requirements: *id004
84
- - !ruby/object:Gem::Dependency
85
- name: mono_logger
86
64
  prerelease: false
87
- requirement: &id005 !ruby/object:Gem::Requirement
88
- none: false
89
- requirements:
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '1.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: mono_logger
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
90
74
  - - ~>
91
- - !ruby/object:Gem::Version
92
- hash: 15
93
- segments:
94
- - 1
95
- - 0
96
- version: "1.0"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.0'
97
77
  type: :runtime
98
- version_requirements: *id005
99
- description: " Resque is a Redis-backed Ruby library for creating background jobs,\n placing those jobs on multiple queues, and processing them later.\n\n Background jobs can be any Ruby class or module that responds to\n perform. Your existing classes can easily be converted to background\n jobs or you can create new classes specifically to do work. Or, you\n can do both.\n\n Resque is heavily inspired by DelayedJob (which rocks) and is\n comprised of three parts:\n\n * A Ruby library for creating, querying, and processing jobs\n * A Rake task for starting a worker which processes jobs\n * A Sinatra app for monitoring queues, jobs, and workers.\n"
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
82
+ - !ruby/object:Gem::Version
83
+ version: '1.0'
84
+ description: |2
85
+ Resque is a Redis-backed Ruby library for creating background jobs,
86
+ placing those jobs on multiple queues, and processing them later.
87
+
88
+ Background jobs can be any Ruby class or module that responds to
89
+ perform. Your existing classes can easily be converted to background
90
+ jobs or you can create new classes specifically to do work. Or, you
91
+ can do both.
92
+
93
+ Resque is heavily inspired by DelayedJob (which rocks) and is
94
+ comprised of three parts:
95
+
96
+ * A Ruby library for creating, querying, and processing jobs
97
+ * A Rake task for starting a worker which processes jobs
98
+ * A Sinatra app for monitoring queues, jobs, and workers.
100
99
  email: chris@ozmm.org
101
- executables:
100
+ executables:
102
101
  - resque
103
102
  - resque-web
104
103
  extensions: []
105
-
106
- extra_rdoc_files:
104
+ extra_rdoc_files:
107
105
  - LICENSE
108
106
  - README.markdown
109
- files:
107
+ files:
110
108
  - README.markdown
111
109
  - Rakefile
112
110
  - LICENSE
@@ -179,39 +177,29 @@ files:
179
177
  - test/resque_test.rb
180
178
  - test/test_helper.rb
181
179
  - test/worker_test.rb
182
- has_rdoc: true
183
180
  homepage: http://github.com/defunkt/resque
184
181
  licenses: []
185
-
182
+ metadata: {}
186
183
  post_install_message:
187
- rdoc_options:
184
+ rdoc_options:
188
185
  - --charset=UTF-8
189
- require_paths:
186
+ require_paths:
190
187
  - lib
191
- required_ruby_version: !ruby/object:Gem::Requirement
192
- none: false
193
- requirements:
194
- - - ">="
195
- - !ruby/object:Gem::Version
196
- hash: 3
197
- segments:
198
- - 0
199
- version: "0"
200
- required_rubygems_version: !ruby/object:Gem::Requirement
201
- none: false
202
- requirements:
203
- - - ">="
204
- - !ruby/object:Gem::Version
205
- hash: 3
206
- segments:
207
- - 0
208
- version: "0"
188
+ required_ruby_version: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - '>='
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ required_rubygems_version: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
209
198
  requirements: []
210
-
211
199
  rubyforge_project:
212
- rubygems_version: 1.6.2
200
+ rubygems_version: 2.0.0
213
201
  signing_key:
214
- specification_version: 3
202
+ specification_version: 4
215
203
  summary: Resque is a Redis-backed queueing system.
216
204
  test_files: []
217
-
205
+ has_rdoc: