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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ea56cb8acd5070d19812f7ca119ff2f2de59284
4
- data.tar.gz: 0b2ef538a18916401814758c9cff1c43ab79379a
3
+ metadata.gz: 3ae3c041bd3a30cd9b921bd9e84914cf575c7eed
4
+ data.tar.gz: 2a34f7f34fab4a6538f960285505b5eb6aebfd6c
5
5
  SHA512:
6
- metadata.gz: d64e29c2190cb2533e701db749d7a642d4b5e0abc8a1f1a27d9c8ebeb7fd11c093aa86e960f8daaaced81d6cc9ea4b57a444ecd42ae6dff4a299c18df483d2fa
7
- data.tar.gz: 84aebc1ad10f36ac0cd58d4f2381fb8d5182fbf9e14d5b7e9f382c885c6c0335a216abd3f9f1d5b3bed5f43aab75d89f80b76b4968f0fdee98f41e496a05336b
6
+ metadata.gz: 66fb296be964c70c4757f38b3d20fa172e439e3de6801d0ecbe06b3b885ce558310dd23efbeadbf0080730b9ca408e0221dffa2e9c1e6be821abf6602d50c374
7
+ data.tar.gz: 6a7e152477cd51f640a6053b5a503d1074ee938a42658ce10497132c7ae45b3d6533f25ca9990054d131bd827d1fde52dc76ccc01bbb6e334d96e6670833c219
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Pool
3
- VERSION = '0.1.5'
3
+ VERSION = '0.1.6'
4
4
  end
5
5
  end
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.5
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-03-31 00:00:00.000000000 Z
11
+ date: 2016-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq