sidekiq 0.9.0 → 0.9.1

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

Potentially problematic release.


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

data/Changes.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.9.1
2
+ -----------
3
+
4
+ - Fix missed deprecations, poor method name in web UI
5
+
1
6
  0.9.0
2
7
  -----------
3
8
 
@@ -3,6 +3,7 @@ require 'sidekiq/client'
3
3
  require 'sidekiq/worker'
4
4
  require 'sidekiq/rails'
5
5
  require 'sidekiq/redis_connection'
6
+ require 'sidekiq/util'
6
7
 
7
8
  require 'sidekiq/extensions/action_mailer'
8
9
  require 'sidekiq/extensions/active_record'
@@ -1,3 +1,3 @@
1
1
  module Sidekiq
2
- VERSION = "0.9.0"
2
+ VERSION = "0.9.1"
3
3
  end
@@ -38,7 +38,7 @@ module Sidekiq
38
38
  helpers do
39
39
  def workers
40
40
  @workers ||= begin
41
- Sidekiq.redis.with_connection do |conn|
41
+ Sidekiq.redis do |conn|
42
42
  conn.smembers('workers').map do |w|
43
43
  msg = conn.get("worker:#{w}")
44
44
  msg = MultiJson.decode(msg) if msg
@@ -49,15 +49,15 @@ module Sidekiq
49
49
  end
50
50
 
51
51
  def processed
52
- Sidekiq.redis.get('stat:processed') || 0
52
+ Sidekiq.redis { |conn| conn.get('stat:processed') } || 0
53
53
  end
54
54
 
55
55
  def failed
56
- Sidekiq.redis.get('stat:failed') || 0
56
+ Sidekiq.redis { |conn| conn.get('stat:failed') } || 0
57
57
  end
58
58
 
59
59
  def queues
60
- Sidekiq.redis.with_connection do |conn|
60
+ Sidekiq.redis do |conn|
61
61
  conn.smembers('queues').map do |q|
62
62
  [q, conn.llen("queue:#{q}") || 0]
63
63
  end.sort { |x,y| x[1] <=> y[1] }
@@ -65,14 +65,14 @@ module Sidekiq
65
65
  end
66
66
 
67
67
  def location
68
- Sidekiq.redis.client.location
68
+ Sidekiq.redis { |conn| conn.client.location }
69
69
  end
70
70
 
71
71
  def root_path
72
72
  "#{env['SCRIPT_NAME']}/"
73
73
  end
74
74
 
75
- def status
75
+ def current_status
76
76
  return 'down' if workers.size == 0
77
77
  return 'idle' if workers.size > 0 && workers.map { |x| x[1] }.compact.size == 0
78
78
  return 'active'
@@ -84,8 +84,9 @@ module Sidekiq
84
84
  end
85
85
 
86
86
  get "/queues/:name" do
87
+ halt 404 unless params[:name]
87
88
  @name = params[:name]
88
- @messages = Sidekiq.redis.lrange("queue:#{@name}", 0, 10).map { |str| MultiJson.decode(str) }
89
+ @messages = Sidekiq.redis {|conn| conn.lrange("queue:#{@name}", 0, 10) }.map { |str| MultiJson.decode(str) }
89
90
  slim :queue
90
91
  end
91
92
  end
@@ -47,5 +47,15 @@ class TestWeb < MiniTest::Unit::TestCase
47
47
  assert_match last_response.body, /foo/
48
48
  end
49
49
 
50
+ it 'handles queues with no name' do
51
+ get '/queues'
52
+ assert_equal 404, last_response.status
53
+ end
54
+
55
+ it 'handles queue view' do
56
+ get '/queues/default'
57
+ assert_equal 200, last_response.status
58
+ end
59
+
50
60
  end
51
61
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  .hero-unit
3
- h1 Sidekiq is #{status}
3
+ h1 Sidekiq is #{current_status}
4
4
  p Processed: #{processed}
5
5
  p Failed: #{failed}
6
6
  p Workers: #{workers.size}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
16
- requirement: &70241342627260 !ruby/object:Gem::Requirement
16
+ requirement: &70238239105760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70241342627260
24
+ version_requirements: *70238239105760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: redis-namespace
27
- requirement: &70241342626820 !ruby/object:Gem::Requirement
27
+ requirement: &70238239105320 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70241342626820
35
+ version_requirements: *70238239105320
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: connection_pool
38
- requirement: &70241342626320 !ruby/object:Gem::Requirement
38
+ requirement: &70238239104820 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.9.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70241342626320
46
+ version_requirements: *70238239104820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: celluloid
49
- requirement: &70241342625900 !ruby/object:Gem::Requirement
49
+ requirement: &70238239104400 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70241342625900
57
+ version_requirements: *70238239104400
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: multi_json
60
- requirement: &70241342625440 !ruby/object:Gem::Requirement
60
+ requirement: &70238239103940 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70241342625440
68
+ version_requirements: *70238239103940
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest
71
- requirement: &70241342625020 !ruby/object:Gem::Requirement
71
+ requirement: &70238239103520 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70241342625020
79
+ version_requirements: *70238239103520
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: sinatra
82
- requirement: &70241342624600 !ruby/object:Gem::Requirement
82
+ requirement: &70238239103100 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70241342624600
90
+ version_requirements: *70238239103100
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: slim
93
- requirement: &70241342624180 !ruby/object:Gem::Requirement
93
+ requirement: &70238239102680 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70241342624180
101
+ version_requirements: *70238239102680
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: rake
104
- requirement: &70241342623760 !ruby/object:Gem::Requirement
104
+ requirement: &70238239102260 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70241342623760
112
+ version_requirements: *70238239102260
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: actionmailer
115
- requirement: &70241342623340 !ruby/object:Gem::Requirement
115
+ requirement: &70238239101840 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70241342623340
123
+ version_requirements: *70238239101840
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: activerecord
126
- requirement: &70241342622920 !ruby/object:Gem::Requirement
126
+ requirement: &70238239101420 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,7 +131,7 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70241342622920
134
+ version_requirements: *70238239101420
135
135
  description: Simple, efficient message processing for Ruby
136
136
  email:
137
137
  - mperham@gmail.com