sidekiq 2.11.1 → 2.11.2

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,11 @@
1
+ 2.11.2
2
+ -----------
3
+
4
+ - Fix Web UI when used without Rails [#886]
5
+ - Add Sidekiq::Stats#reset [#349]
6
+ - Add Norwegian locale.
7
+ - Updates for the JA locale.
8
+
1
9
  2.11.1
2
10
  -----------
3
11
 
@@ -16,6 +16,13 @@ module Sidekiq
16
16
  count.nil? ? 0 : count.to_i
17
17
  end
18
18
 
19
+ def reset
20
+ Sidekiq.redis do |conn|
21
+ conn.set("stat:failed", 0)
22
+ conn.set("stat:processed", 0)
23
+ end
24
+ end
25
+
19
26
  def queues
20
27
  Sidekiq.redis do |conn|
21
28
  queues = conn.smembers('queues')
@@ -248,7 +248,7 @@ module Sidekiq
248
248
  end
249
249
 
250
250
  o.on '-i', '--index INT', "unique process index on this machine" do |arg|
251
- opts[:index] = Integer(arg)
251
+ opts[:index] = Integer(arg.match(/\d+/)[0])
252
252
  end
253
253
 
254
254
  o.on '-p', '--profile', "Profile all code run by Sidekiq" do |arg|
@@ -1,3 +1,3 @@
1
1
  module Sidekiq
2
- VERSION = "2.11.1"
2
+ VERSION = "2.11.2"
3
3
  end
@@ -1,5 +1,9 @@
1
+ require 'yaml'
1
2
  require 'sinatra/base'
2
3
  require 'slim'
4
+
5
+ require 'sidekiq'
6
+ require 'sidekiq/api'
3
7
  require 'sidekiq/paginator'
4
8
 
5
9
  module Sidekiq
@@ -24,11 +28,11 @@ module Sidekiq
24
28
  end
25
29
 
26
30
  def get_locale
27
- (request.env["HTTP_ACCEPT_LANGUAGE"] || 'en')[0,2]
31
+ strings[(request.env["HTTP_ACCEPT_LANGUAGE"] || 'en')[0,2]] || strings['en']
28
32
  end
29
33
 
30
34
  def t(msg, options={})
31
- string = strings[get_locale] ? strings[get_locale].fetch(msg) : strings['en'].fetch(msg)
35
+ string = get_locale[msg] || msg
32
36
  string % options
33
37
  end
34
38
 
@@ -14,16 +14,16 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "sidekiq"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Sidekiq::VERSION
17
- gem.add_dependency 'redis', '~> 3'
17
+ gem.add_dependency 'redis', '>= 3.0'
18
18
  gem.add_dependency 'redis-namespace'
19
- gem.add_dependency 'connection_pool', '~> 1.0'
20
- gem.add_dependency 'celluloid', '~> 0.13.0'
21
- gem.add_dependency 'multi_json', '~> 1'
19
+ gem.add_dependency 'connection_pool', '>= 1.0.0'
20
+ gem.add_dependency 'celluloid', '>= 0.13.0'
21
+ gem.add_dependency 'multi_json'
22
22
  gem.add_development_dependency 'sinatra'
23
23
  gem.add_development_dependency 'slim'
24
- gem.add_development_dependency 'minitest', '~> 4'
24
+ gem.add_development_dependency 'minitest'
25
25
  gem.add_development_dependency 'rake'
26
- gem.add_development_dependency 'actionmailer', '~> 3'
27
- gem.add_development_dependency 'activerecord', '~> 3'
26
+ gem.add_development_dependency 'actionmailer'
27
+ gem.add_development_dependency 'activerecord'
28
28
  gem.add_development_dependency 'coveralls'
29
29
  end
@@ -32,6 +32,18 @@ class TestApi < MiniTest::Unit::TestCase
32
32
  end
33
33
  end
34
34
 
35
+ describe "reset" do
36
+ it 'can reset stats' do
37
+ Sidekiq.redis do |conn|
38
+ conn.set('stat:processed', 5)
39
+ conn.set('stat:failed', 10)
40
+ Sidekiq::Stats.new.reset
41
+ assert_equal '0', conn.get('stat:processed')
42
+ assert_equal '0', conn.get('stat:failed')
43
+ end
44
+ end
45
+ end
46
+
35
47
  describe "queues" do
36
48
  it "is initially empty" do
37
49
  s = Sidekiq::Stats.new
@@ -45,6 +45,11 @@ class TestCli < MiniTest::Unit::TestCase
45
45
  assert_equal 7, Sidekiq.options[:index]
46
46
  end
47
47
 
48
+ it 'accepts a stringy process index' do
49
+ @cli.parse(['sidekiq', '-i', 'worker.7', '-r', './test/fake_env.rb'])
50
+ assert_equal 7, Sidekiq.options[:index]
51
+ end
52
+
48
53
  it 'sets strictly ordered queues if weights are not present' do
49
54
  @cli.parse(['sidekiq', '-q', 'foo,bar', '-r', './test/fake_env.rb'])
50
55
  assert_equal true, !!Sidekiq.options[:strict]
@@ -1,5 +1,5 @@
1
1
  # elements like %{queue} are variables and should not be translated
2
- en:
2
+ en: # <---- change this to your locale code
3
3
  Dashboard: Dashboard
4
4
  Status: Status
5
5
  Time: Time
@@ -1,7 +1,7 @@
1
1
  # elements like %{queue} are variables and should not be translated
2
2
  ja:
3
3
  Dashboard: ダッシュボード
4
- Status: ステータス
4
+ Status: 状態
5
5
  Time: 時間
6
6
  Namespace: ネームスペース
7
7
  Realtime: リアルタイム
@@ -15,8 +15,8 @@ ja:
15
15
  ClearWorkerList: 動作中の作業を停止
16
16
  Worker: 動作中の作業
17
17
  Workers: 動作中の作業
18
- LivePoll: 転送中
19
- StopPolling: 転送停止
18
+ LivePoll: ポーリング開始
19
+ StopPolling: ポーリング停止
20
20
  Queue: キュー
21
21
  Class: クラス
22
22
  Job: ジョブ
@@ -25,8 +25,8 @@ ja:
25
25
  ShowAll: 全て見せる
26
26
  CurrentMessagesInQueue: <span class='title'>%{queue}</span>に メッセージがあります
27
27
  Delete: 削除
28
- AreYouSureDeleteJob: 本当にこの作業を削除しますか?
29
- AreYouSureDeleteQueue: 本当に %{queue} キュー 削除しますか?
28
+ AreYouSureDeleteJob: このジョブを削除しますか?
29
+ AreYouSureDeleteQueue: この %{queue} キューを削除しますか?
30
30
  Queues: キュー
31
31
  Size: サイズ
32
32
  Actions: アクション
@@ -35,7 +35,7 @@ ja:
35
35
  RetryNow: 今すぐ再試行
36
36
  LastRetry: 再試行履歴
37
37
  OriginallyFailed: 失敗
38
- AreYouSure: 本当にいいですか?
38
+ AreYouSure: いいですか?
39
39
  DeleteAll: 全て削除
40
40
  RetryAll: 全て再試行
41
41
  NoRetriesFound: 再試行できません
@@ -47,16 +47,16 @@ ja:
47
47
  NoScheduledFound: 予定された作業はありません
48
48
  When: いつ
49
49
  ScheduledJobs: 予定された作業
50
- idle: アイドル状態
50
+ idle: アイドル
51
51
  active: アクティブ
52
52
  Version: バージョン
53
53
  Connections: 接続
54
54
  MemoryUsage: メモリー容量
55
55
  PeakMemoryUsage: 最大メモリー容量
56
56
  Uptime: Uptime (days)
57
- OneWeek: 1週
57
+ OneWeek: 1 週
58
58
  OneMonth: 1 ヶ月
59
59
  ThreeMonths: 3 ヶ月
60
60
  SixMonths: 6 ヶ月
61
- Batches: Batches
61
+ Batches: バッチ
62
62
  Failures: 失敗
@@ -0,0 +1,62 @@
1
+ # elements like %{queue} are variables and should not be translated
2
+ no:
3
+ Dashboard: Oversikt
4
+ Status: Status
5
+ Time: Tid
6
+ Namespace: Navnerom
7
+ Realtime: Sanntid
8
+ History: Historikk
9
+ Busy: Opptatt
10
+ Processed: Prosessert
11
+ Failed: Mislykket
12
+ Scheduled: Planlagt
13
+ Retries: Forsøk
14
+ Enqueued: I kø
15
+ ClearWorkerList: Nullstill jobbliste
16
+ Worker: Arbeider
17
+ Workers: Arbeidere
18
+ LivePoll: Automatisk oppdatering
19
+ StopPolling: Stopp automatisk oppdatering
20
+ Queue: Kø
21
+ Class: Klasse
22
+ Job: Jobb
23
+ Arguments: Argumenter
24
+ Started: Startet
25
+ ShowAll: Vis alle
26
+ CurrentMessagesInQueue: Nåværende melding i <span class='title'>%{queue}</span>
27
+ Delete: Slett
28
+ AreYouSureDeleteJob: Er du sikker på at du vil slette denne jobben?
29
+ AreYouSureDeleteQueue: Er du sikker på at du vil slette køen %{queue}?
30
+ Queues: Køer
31
+ Size: Størrelse
32
+ Actions: Handlinger
33
+ NextRetry: Neste forsøk
34
+ RetryCount: Antall forsøk
35
+ RetryNow: Forsøk igjen nå
36
+ LastRetry: Forrige forsøk
37
+ OriginallyFailed: Feilet opprinnelig
38
+ AreYouSure: Er du sikker?
39
+ DeleteAll: Slett alle
40
+ RetryAll: Forsøk alle på nytt
41
+ NoRetriesFound: Ingen forsøk funnet
42
+ Error: Feil
43
+ ErrorClass: Feilklasse
44
+ ErrorMessage: Feilmelding
45
+ ErrorBacktrace: Feilbakgrunn
46
+ GoBack: ← Tilbake
47
+ NoScheduledFound: Ingen planlagte jobber funnet
48
+ When: Når
49
+ ScheduledJobs: Planlagte jobber
50
+ idle: uvirksom
51
+ active: aktiv
52
+ Version: Versjon
53
+ Connections: Tilkoblinger
54
+ MemoryUsage: Minneforbruk
55
+ PeakMemoryUsage: Høyeste minneforbruk
56
+ Uptime: Oppetid (dager)
57
+ OneWeek: 1 uke
58
+ OneMonth: 1 måned
59
+ ThreeMonths: 3 måneder
60
+ SixMonths: 6 måneder
61
+ Batches: Samlinger
62
+ Failures: Mislykkeser
@@ -13,4 +13,5 @@
13
13
 
14
14
  - custom_tabs.each do |title, url|
15
15
  li class="#{(current_path =~ Regexp.new(url)) ? 'active':''}"
16
- a href='#{{root_path}}#{{url}}' = title
16
+ a href='#{{root_path}}#{{url}}' = t(title)
17
+
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: 2.11.1
4
+ version: 2.11.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-25 00:00:00.000000000 Z
12
+ date: 2013-05-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: redis
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '3'
21
+ version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: '3'
29
+ version: '3.0'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: redis-namespace
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -48,23 +48,23 @@ dependencies:
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ~>
51
+ - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: '1.0'
53
+ version: 1.0.0
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ~>
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: '1.0'
61
+ version: 1.0.0
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: celluloid
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
67
- - - ~>
67
+ - - ! '>='
68
68
  - !ruby/object:Gem::Version
69
69
  version: 0.13.0
70
70
  type: :runtime
@@ -72,7 +72,7 @@ dependencies:
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
- - - ~>
75
+ - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: 0.13.0
78
78
  - !ruby/object:Gem::Dependency
@@ -80,17 +80,17 @@ dependencies:
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
- - - ~>
83
+ - - ! '>='
84
84
  - !ruby/object:Gem::Version
85
- version: '1'
85
+ version: '0'
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
- - - ~>
91
+ - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
- version: '1'
93
+ version: '0'
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: sinatra
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -128,17 +128,17 @@ dependencies:
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  none: false
130
130
  requirements:
131
- - - ~>
131
+ - - ! '>='
132
132
  - !ruby/object:Gem::Version
133
- version: '4'
133
+ version: '0'
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  none: false
138
138
  requirements:
139
- - - ~>
139
+ - - ! '>='
140
140
  - !ruby/object:Gem::Version
141
- version: '4'
141
+ version: '0'
142
142
  - !ruby/object:Gem::Dependency
143
143
  name: rake
144
144
  requirement: !ruby/object:Gem::Requirement
@@ -160,33 +160,33 @@ dependencies:
160
160
  requirement: !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
- - - ~>
163
+ - - ! '>='
164
164
  - !ruby/object:Gem::Version
165
- version: '3'
165
+ version: '0'
166
166
  type: :development
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  none: false
170
170
  requirements:
171
- - - ~>
171
+ - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
- version: '3'
173
+ version: '0'
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: activerecord
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements:
179
- - - ~>
179
+ - - ! '>='
180
180
  - !ruby/object:Gem::Version
181
- version: '3'
181
+ version: '0'
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  none: false
186
186
  requirements:
187
- - - ~>
187
+ - - ! '>='
188
188
  - !ruby/object:Gem::Version
189
- version: '3'
189
+ version: '0'
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: coveralls
192
192
  requirement: !ruby/object:Gem::Requirement
@@ -294,6 +294,7 @@ files:
294
294
  - web/locales/it.yml
295
295
  - web/locales/ja.yml
296
296
  - web/locales/nl.yml
297
+ - web/locales/no.yml
297
298
  - web/locales/pl.yml
298
299
  - web/locales/pt-br.yml
299
300
  - web/locales/pt.yml