process_settings 0.16.0 → 0.17.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/README.md +13 -0
- data/lib/process_settings/file_monitor.rb +5 -1
- data/lib/process_settings/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93741a97801bc4783109ff2423f1d1254f764ccad969f8810e242cb32a48ca18
|
4
|
+
data.tar.gz: 8e8a865c9f03fa41dc9dd61b5aaa2d59ef86fb66753ca891898942677c9c518e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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?
|