sidekiq-pool 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/sidekiq/pool/cli.rb +5 -9
- 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: a5974ee249b01b0fb3a17c162fede983844a9d00
|
|
4
|
+
data.tar.gz: 4cde7515556b589535e6e2c1b75e684af65a1066
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 531cb2f5f5441385f62fcefff96f7cc18ae7983f3c26d6cabaf4bb007afe3559b7f4045d244ad2d61d99ca196c61c0c7be320d95fcaabc29876edd1afeb990ef
|
|
7
|
+
data.tar.gz: 3559bfeb53c632f4ad257a9256ca9779bc644df993711ee6db65d3a8371d35874e9ab0056bfceb4e8b2248b7a6ff8e320fb23d375a0dcb99d43c82d222c74f61
|
data/lib/sidekiq/pool/cli.rb
CHANGED
|
@@ -50,7 +50,7 @@ module Sidekiq
|
|
|
50
50
|
@types.each do |type|
|
|
51
51
|
type[:amount].times do
|
|
52
52
|
sleep @fork_wait || DEFAULT_FORK_WAIT
|
|
53
|
-
|
|
53
|
+
fork_child(type[:command])
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
end
|
|
@@ -166,7 +166,8 @@ module Sidekiq
|
|
|
166
166
|
end
|
|
167
167
|
end
|
|
168
168
|
|
|
169
|
-
def fork_child(command)
|
|
169
|
+
def fork_child(command, wait_for_busy = true)
|
|
170
|
+
logger.info "Adding child with args: (#{command}), waiting for busy: #{wait_for_busy}"
|
|
170
171
|
pid = fork do
|
|
171
172
|
opts = parse_options(command.split)
|
|
172
173
|
options.merge!(opts)
|
|
@@ -183,7 +184,7 @@ module Sidekiq
|
|
|
183
184
|
break if (wait_until_child_loaded -= 1).zero?
|
|
184
185
|
logger.info "Waiting for child #{pid} to be busy break in #{wait_until_child_loaded}"
|
|
185
186
|
sleep 1
|
|
186
|
-
end
|
|
187
|
+
end if wait_for_busy
|
|
187
188
|
|
|
188
189
|
@pool << { pid: pid, command: command }
|
|
189
190
|
end
|
|
@@ -230,11 +231,6 @@ module Sidekiq
|
|
|
230
231
|
end
|
|
231
232
|
end
|
|
232
233
|
|
|
233
|
-
def add_child(*arg)
|
|
234
|
-
logger.info "Adding child with args: #{arg}"
|
|
235
|
-
fork_child(*arg)
|
|
236
|
-
end
|
|
237
|
-
|
|
238
234
|
def signal_to_pool(sig, given_pool = @pool)
|
|
239
235
|
given_pool.each { |child| signal_to_child(sig, child[:pid]) }
|
|
240
236
|
end
|
|
@@ -256,7 +252,7 @@ module Sidekiq
|
|
|
256
252
|
def handle_dead_child(child)
|
|
257
253
|
logger.info "Child #{child[:pid]} died"
|
|
258
254
|
@pool.delete(child)
|
|
259
|
-
|
|
255
|
+
fork_child(child[:command], false)
|
|
260
256
|
end
|
|
261
257
|
|
|
262
258
|
def alive?(pid)
|
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: 1.
|
|
4
|
+
version: 1.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Laurynas Butkus
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-01-
|
|
11
|
+
date: 2017-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sidekiq
|