resque 1.27.1 → 1.27.2

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
  SHA1:
3
- metadata.gz: 1daac3d258fab0d2df0f3b9c8fd8a65ccbc2c885
4
- data.tar.gz: 88d64df16da1b0312bdd314f46e9a8776d787c13
3
+ metadata.gz: c9757198382c0b8e5cf383fc49fe82ce4f59933e
4
+ data.tar.gz: 6dbda5f17bf9cb44f99c18724b0cb6a6e1422e73
5
5
  SHA512:
6
- metadata.gz: 834bcae49f7c471737d6ceb360162a830b403d2ca36c099cee05d5d2a8c24f163bbfeb101080042e023351a34c2007f63dd1f6e19da8847d9487d8743977029a
7
- data.tar.gz: cf65256fb4d939ebed384ca9cd1e6a30eef611167bfaa3abeb427f79f5cf005f79c9d85146a4dbe7cec429bbdaff27c04a802c7993acbfb4477a832314f84fb2
6
+ metadata.gz: 45cc843a75953f9b5e08ebcded0caafa7da8a833489d6c48922b68d6fecc3192ddd4dbce3f77dffc45cf187a89e6a1e79509a2043e9ce11081996e8466561d75
7
+ data.tar.gz: 6d5c2fdc451fd17b50b1d82a7f7ed94a25aad40af6cc0515e0cace4304944b0539fee3cc42c64a8608db64135fec5d79db0f9fb6c5f1d13531794923078c4f96
data/HISTORY.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Nothing yet!
4
4
 
5
+ ## 1.27.2 (2017-02-20)
6
+
7
+ ### Fixed
8
+ * Require "redis/distributed" in worker.rb to allow proper rescuing
9
+ * Fallback to server time if Redis time won't work (restores Redis 2.4 support)
10
+
5
11
  ## 1.27.1 (2017-02-13)
6
12
 
7
13
  ### Fixed
@@ -195,7 +195,7 @@ We plan to provide first class `async` support in a future release.
195
195
 
196
196
  If a job raises an exception, it is logged and handed off to the
197
197
  `Resque::Failure` module. Failures are logged either locally in Redis
198
- or using some different backend. To see exceptions while developing,
198
+ or using some different backend. To see exceptions while developing,
199
199
  use VERBOSE env variable, see details below under Logging.
200
200
 
201
201
  For example, Resque ships with Airbrake support. To configure it, put
@@ -634,6 +634,13 @@ require 'your/app'
634
634
  require 'resque/tasks'
635
635
  ```
636
636
 
637
+ If you're using Rails 5.x, include the following in lib/tasks/resque.rb:
638
+
639
+ ```ruby
640
+ require 'resque/tasks'
641
+ task 'resque:setup' => :environment
642
+ ```
643
+
637
644
  Now:
638
645
 
639
646
  $ QUEUE=* rake resque:work
@@ -7,11 +7,12 @@ module Resque
7
7
  HEARTBEAT_KEY = "workers:heartbeat"
8
8
 
9
9
  def initialize(redis)
10
- @redis = redis
11
- @queue_access = QueueAccess.new(@redis)
12
- @failed_queue_access = FailedQueueAccess.new(@redis)
13
- @workers = Workers.new(@redis)
14
- @stats_access = StatsAccess.new(@redis)
10
+ @redis = redis
11
+ @queue_access = QueueAccess.new(@redis)
12
+ @failed_queue_access = FailedQueueAccess.new(@redis)
13
+ @workers = Workers.new(@redis)
14
+ @stats_access = StatsAccess.new(@redis)
15
+ @redis_time_available = redis_time_available?
15
16
  end
16
17
 
17
18
  def_delegators :@queue_access, :push_to_queue,
@@ -91,10 +92,17 @@ module Resque
91
92
  end
92
93
 
93
94
  def server_time
94
- time, _ = @redis.time
95
+ time, _ = @redis_time_available ? @redis.time : Time.now
95
96
  Time.at(time)
96
97
  end
97
98
 
99
+ def redis_time_available?
100
+ @redis.time
101
+ rescue Redis::CommandError
102
+ false
103
+ end
104
+ private :redis_time_available?
105
+
98
106
  class QueueAccess
99
107
  def initialize(redis)
100
108
  @redis = redis
@@ -299,7 +307,6 @@ module Resque
299
307
  def redis_key_for_worker_start_time(worker)
300
308
  "#{redis_key_for_worker(worker)}:started"
301
309
  end
302
-
303
310
  end
304
311
 
305
312
  class StatsAccess
@@ -8,7 +8,7 @@ body { padding:0; margin:0; }
8
8
  .header ul li a:hover { background:#333;}
9
9
  .header ul li.current a { background:#ce1212; font-weight:bold; color:#fff;}
10
10
 
11
- .header .namespace { position: absolute; right: 75px; top: 10px; color: #7A7A7A; }
11
+ .header .namespace { position: absolute; right: 75px; top: 12px; color: #FFF; font-weight: bold; }
12
12
 
13
13
  .subnav { padding:2px 5% 7px 5%; background:#ce1212; font-size:90%;}
14
14
  .subnav li { display:inline;}
@@ -88,4 +88,4 @@ body { padding:0; margin:0; }
88
88
 
89
89
  #failed tr.total td {background-color: #FFECEC; color: #D37474; font-size: 15px; font-weight: bold;}
90
90
  #failed .center {text-align: center;}
91
- #failed .failed_class { padding-left: 20px; font-size:12px; }
91
+ #failed .failed_class { padding-left: 20px; font-size:12px; }
@@ -1,3 +1,3 @@
1
1
  module Resque
2
- Version = VERSION = '1.27.1'
2
+ Version = VERSION = '1.27.2'
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'time'
2
2
  require 'set'
3
+ require 'redis/distributed'
3
4
 
4
5
  module Resque
5
6
  # A Resque Worker processes jobs. On platforms that support fork(2),
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.1
4
+ version: 1.27.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-02-13 00:00:00.000000000 Z
13
+ date: 2017-02-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: redis-namespace
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.5.1
189
+ rubygems_version: 2.6.10
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Resque is a Redis-backed queueing system.