sidekiq-pool 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sidekiq/pool/cli.rb +23 -0
- data/lib/sidekiq/pool/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ae3c041bd3a30cd9b921bd9e84914cf575c7eed
|
4
|
+
data.tar.gz: 2a34f7f34fab4a6538f960285505b5eb6aebfd6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66fb296be964c70c4757f38b3d20fa172e439e3de6801d0ecbe06b3b885ce558310dd23efbeadbf0080730b9ca408e0221dffa2e9c1e6be821abf6602d50c374
|
7
|
+
data.tar.gz: 6a7e152477cd51f640a6053b5a503d1074ee938a42658ce10497132c7ae45b3d6533f25ca9990054d131bd827d1fde52dc76ccc01bbb6e334d96e6670833c219
|
data/lib/sidekiq/pool/cli.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'sidekiq/cli'
|
2
|
+
require 'sidekiq/pool/version'
|
2
3
|
|
3
4
|
module Sidekiq
|
4
5
|
module Pool
|
@@ -6,6 +7,7 @@ module Sidekiq
|
|
6
7
|
def initialize
|
7
8
|
@child_index = 0
|
8
9
|
@pool = []
|
10
|
+
@done = false
|
9
11
|
super
|
10
12
|
end
|
11
13
|
|
@@ -17,6 +19,7 @@ module Sidekiq
|
|
17
19
|
@master_pid = $$
|
18
20
|
|
19
21
|
trap_signals
|
22
|
+
update_process_name
|
20
23
|
|
21
24
|
@pool_size.times do
|
22
25
|
sleep @fork_wait || DEFAULT_FORK_WAIT
|
@@ -129,6 +132,7 @@ module Sidekiq
|
|
129
132
|
def fork_child
|
130
133
|
@pool << fork do
|
131
134
|
@self_write.close
|
135
|
+
$0 = 'sidekiq starting'
|
132
136
|
options[:index] = @child_index++
|
133
137
|
run_child
|
134
138
|
end
|
@@ -208,7 +212,10 @@ module Sidekiq
|
|
208
212
|
end
|
209
213
|
|
210
214
|
def stop_children
|
215
|
+
@done = true
|
211
216
|
logger.info 'Stopping children'
|
217
|
+
update_process_name
|
218
|
+
|
212
219
|
time = Time.now
|
213
220
|
loop do
|
214
221
|
wait_time = (Time.now - time).to_i
|
@@ -227,6 +234,22 @@ module Sidekiq
|
|
227
234
|
def fork?
|
228
235
|
$$ != @master_pid
|
229
236
|
end
|
237
|
+
|
238
|
+
def stopping?
|
239
|
+
@done
|
240
|
+
end
|
241
|
+
|
242
|
+
def update_process_name
|
243
|
+
parts = [
|
244
|
+
'sidekiq-pool',
|
245
|
+
Sidekiq::Pool::VERSION,
|
246
|
+
options[:tag]
|
247
|
+
]
|
248
|
+
|
249
|
+
parts << 'stopping' if stopping?
|
250
|
+
|
251
|
+
$0 = parts.compact.join(' ')
|
252
|
+
end
|
230
253
|
end
|
231
254
|
end
|
232
255
|
end
|
data/lib/sidekiq/pool/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-pool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Laurynas Butkus
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|