process_settings 0.16.0 → 0.17.0

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
  SHA256:
3
- metadata.gz: fe4e35a75d3c8a06396dbc7094874cf5e2509847f66c442ff5297e9c8011cebd
4
- data.tar.gz: a7b18e595bde05fd56037570a80008bf3f0cc5d679810dce724a63977fec9a02
3
+ metadata.gz: 93741a97801bc4783109ff2423f1d1254f764ccad969f8810e242cb32a48ca18
4
+ data.tar.gz: 8e8a865c9f03fa41dc9dd61b5aaa2d59ef86fb66753ca891898942677c9c518e
5
5
  SHA512:
6
- metadata.gz: 3f972dcfa9f6e7f988866ac290e71231f0a005842105a284e6a688123e74f9e970ec60749675d0855b47d13d344462169f29cd70b7251b799ae6a6ef4f82b6a6
7
- data.tar.gz: e30ad37d7c7508c70471c75322ffcf98c981fb54bdf0e339e6ab512d95c04a8bcd2dad5917381c0a2fbd3ce468e1f04cc18bc0c7919bc9848be3f8b934155853
6
+ metadata.gz: f42cb27c7d884a6be0e4543fe148f2e7cc68d2f8e41883789a5ee5a32db9ee4cec5de349f0f576dcb551f07f60e1b9d749a8d4b122ba43aa7346c4cb13f91014
7
+ data.tar.gz: 981330f869266006284477f9146f6686724d0240745ec4112b1b62ba090e4d28f5a211f3a515a3dba1a70f538e87a8191c6d81958c71f628711879031e8e1d11
data/README.md CHANGED
@@ -167,6 +167,19 @@ This will be applied in any process that has (`service_name == "frontend"` OR `s
167
167
  ### Precedence
168
168
  The settings YAML files are always combined in alphabetical order by file path. Later settings take precedence over the earlier ones.
169
169
 
170
+ ### Forked Processes
171
+ When using `ProcessSettings` within an environment that is forking threads (like `unicorn` web servers), you can restart the `FileMonitor`
172
+ after the fork with `restart_after_fork`.
173
+ ```ruby
174
+ # unicorn.rb
175
+
176
+ preload_app true
177
+
178
+ after_fork do
179
+ ProcessSettings.instance.restart_after_fork
180
+ end
181
+ ```
182
+
170
183
  ### Testing
171
184
  For testing, it is often necessary to set a specific override hash for the process_settings values to use in
172
185
  that use case. The `ProcessSettings::Testing::RSpec::Helpers` and `ProcessSettings::Testing::Minitest::Helpers` modules are provided for this purpose.
@@ -27,7 +27,11 @@ module ProcessSettings
27
27
  def start
28
28
  start_internal(enable_listen_thread?)
29
29
  end
30
- deprecate :start, deprecator: ActiveSupport::Deprecation.new('1.0', 'ProcessSettings') # will become private
30
+ deprecate start: :restart_after_fork, deprecator: ActiveSupport::Deprecation.new('1.0', 'ProcessSettings')
31
+
32
+ def restart_after_fork
33
+ start_internal(enable_listen_thread?)
34
+ end
31
35
 
32
36
  def listen_thread_running?
33
37
  !@listener.nil?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ProcessSettings
4
- VERSION = '0.16.0'
4
+ VERSION = '0.17.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: process_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Invoca