sidekiq-pool 1.5.0 → 1.5.1

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: a5974ee249b01b0fb3a17c162fede983844a9d00
4
- data.tar.gz: 4cde7515556b589535e6e2c1b75e684af65a1066
3
+ metadata.gz: 0887032da31ec1d52ea77dfd7414b2930ba0bf3d
4
+ data.tar.gz: 266f2a1ea4abdb758e59908abf8c579c752c2354
5
5
  SHA512:
6
- metadata.gz: 531cb2f5f5441385f62fcefff96f7cc18ae7983f3c26d6cabaf4bb007afe3559b7f4045d244ad2d61d99ca196c61c0c7be320d95fcaabc29876edd1afeb990ef
7
- data.tar.gz: 3559bfeb53c632f4ad257a9256ca9779bc644df993711ee6db65d3a8371d35874e9ab0056bfceb4e8b2248b7a6ff8e320fb23d375a0dcb99d43c82d222c74f61
6
+ metadata.gz: 88803cd1358a5bb08ca9bc7fb6bcaf4346eacca9b4ca3bc5346726ce71ba0d1f3bcb7af9a437f30863ef096b9688692d3244a26965c70932670affbee4b4a8d9
7
+ data.tar.gz: f73a33bf8a23d85dded6ea5b3d7ce869ac85536fb2278ed31e605a6ecc0267c1d367e483b9ad2134983282bcf32c66a717be82c0875828926f6e5f58f2654cd0
@@ -41,11 +41,13 @@ module Sidekiq
41
41
 
42
42
  DEFAULT_FORK_WAIT = 1
43
43
 
44
+ def working_directory
45
+ @working_directory || @settings[:working_directory]
46
+ end
47
+
44
48
  def start_new_pool
45
49
  logger.info 'Starting new pool'
46
50
  @settings = parse_config_file(@pool_config)
47
- working_directory = @working_directory || @settings[:working_directory]
48
- Dir.chdir(working_directory) if working_directory
49
51
  @types = @settings[:workers]
50
52
  @types.each do |type|
51
53
  type[:amount].times do
@@ -167,8 +169,14 @@ module Sidekiq
167
169
  end
168
170
 
169
171
  def fork_child(command, wait_for_busy = true)
170
- logger.info "Adding child with args: (#{command}), waiting for busy: #{wait_for_busy}"
172
+ logger.info "Adding child with args: (#{command}) in #{working_directory}, waiting for busy: #{wait_for_busy}"
173
+ if working_directory && !Dir.exist?(working_directory)
174
+ logger.info "Working directory: #{working_directory} does not exist unable to fork"
175
+ return
176
+ end
177
+
171
178
  pid = fork do
179
+ Dir.chdir(working_directory) if working_directory
172
180
  opts = parse_options(command.split)
173
181
  options.merge!(opts)
174
182
 
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Pool
3
- VERSION = '1.5.0'
3
+ VERSION = '1.5.1'
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: 1.5.0
4
+ version: 1.5.1
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-16 00:00:00.000000000 Z
11
+ date: 2017-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sidekiq