sidekiq-pool 1.9.0 → 1.9.1
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 +9 -8
- data/lib/sidekiq/pool/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf98a1a08f14125a21317d2846177402c75beea40e6204e63889db1bd43320ca
|
|
4
|
+
data.tar.gz: f3d39f372b981c12c312e4cd76fd7788bcdcea1122aa320fa12290195798eaaf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f23137a068a0e6d9a8736df5104875b88c7ed0e70189ad7753cea33c5c62a3e522be30556745b63b1c8ec2656eea135739b361adc70196ec604b2cc3f2ce7d3f
|
|
7
|
+
data.tar.gz: f82f7f8bed62b0f5e8768c35710eadbb938c21609a0493a050a5227c7b75276e3bd196d123ecbabe2f8bda6976a03c426d2a81171caf6e46194f36bfdc4d223e
|
data/lib/sidekiq/pool/cli.rb
CHANGED
|
@@ -11,7 +11,6 @@ module Sidekiq
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
def initialize
|
|
14
|
-
@child_index = 0
|
|
15
14
|
@pool = []
|
|
16
15
|
@done = false
|
|
17
16
|
@system_booted = false
|
|
@@ -74,10 +73,12 @@ module Sidekiq
|
|
|
74
73
|
boot_system
|
|
75
74
|
|
|
76
75
|
@types = @settings[:workers]
|
|
76
|
+
index = -1
|
|
77
77
|
@types.each do |type|
|
|
78
78
|
type[:amount].times do
|
|
79
|
+
index += 1
|
|
79
80
|
sleep @fork_wait || DEFAULT_FORK_WAIT
|
|
80
|
-
fork_child(type[:command])
|
|
81
|
+
fork_child(type[:command], index)
|
|
81
82
|
end
|
|
82
83
|
end
|
|
83
84
|
drop_reload_marker
|
|
@@ -194,7 +195,7 @@ module Sidekiq
|
|
|
194
195
|
end
|
|
195
196
|
end
|
|
196
197
|
|
|
197
|
-
def fork_child(command, wait_for_busy = true)
|
|
198
|
+
def fork_child(command, index, wait_for_busy = true)
|
|
198
199
|
logger.info "Adding child with args: (#{command}) in #{working_directory}, waiting for busy: #{wait_for_busy}"
|
|
199
200
|
if working_directory && !Dir.exist?(working_directory)
|
|
200
201
|
logger.info "Working directory: #{working_directory} does not exist unable to fork"
|
|
@@ -208,13 +209,13 @@ module Sidekiq
|
|
|
208
209
|
|
|
209
210
|
@self_write.close
|
|
210
211
|
$0 = 'sidekiq starting'
|
|
211
|
-
|
|
212
|
-
options[:index] = @child_index
|
|
212
|
+
options[:index] = index
|
|
213
213
|
|
|
214
214
|
# reset child identity
|
|
215
215
|
@@process_nonce = nil
|
|
216
216
|
@@identity = nil
|
|
217
217
|
options[:identity] = identity
|
|
218
|
+
options[:tag] = "worker #{index}"
|
|
218
219
|
|
|
219
220
|
run_after_fork_hooks
|
|
220
221
|
run_child
|
|
@@ -228,7 +229,7 @@ module Sidekiq
|
|
|
228
229
|
sleep 1
|
|
229
230
|
end if wait_for_busy
|
|
230
231
|
|
|
231
|
-
@pool << { pid: pid, command: command }
|
|
232
|
+
@pool << { pid: pid, index: index, command: command }
|
|
232
233
|
end
|
|
233
234
|
|
|
234
235
|
def wait_for_signals
|
|
@@ -314,9 +315,9 @@ module Sidekiq
|
|
|
314
315
|
end
|
|
315
316
|
|
|
316
317
|
def handle_dead_child(child)
|
|
317
|
-
logger.info "Child #{child[:pid]} died"
|
|
318
|
+
logger.info "Child #{child[:pid]} (worker #{child[:index]}) died"
|
|
318
319
|
@pool.delete(child)
|
|
319
|
-
fork_child(child[:command], false)
|
|
320
|
+
fork_child(child[:command], child[:index], false)
|
|
320
321
|
end
|
|
321
322
|
|
|
322
323
|
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.9.
|
|
4
|
+
version: 1.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vinted
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: sidekiq
|