process_settings 0.11.0.pre.1 → 0.11.0.pre.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/process_settings/file_monitor.rb +22 -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: f0f65d96e096213f9c86c00d170f46a7c2f316cafa73b1689f1a2e8c4533a04c
|
4
|
+
data.tar.gz: 78ed8448055b794871c8ac1d3a59f4d5535c4c089f09228fab99de0032e29f9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bdadd58245649ae32c928a73b58d024969ef267ce79db90ee1caaf3031d79928ca2d207cb19a37f07c480a5c783eefe6f276308bff2acd524b2e30246bbdfd3
|
7
|
+
data.tar.gz: 5076a8f2fd8abfbe4e0e1cb7718d71abad25f95a4d5e3e75ca7ffefa14b84f1d48e11eb36f39f3a35944bdbe39d95fb41a1306faf06d02490fcc7ad044b3253d
|
@@ -45,7 +45,7 @@ module ProcessSettings
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
|
48
|
+
if enable_listen_thread?
|
49
49
|
@listener.start
|
50
50
|
end
|
51
51
|
|
@@ -58,8 +58,29 @@ module ProcessSettings
|
|
58
58
|
@listener&.stop
|
59
59
|
end
|
60
60
|
|
61
|
+
def enable_listen_thread?
|
62
|
+
!disable_listen_thread?
|
63
|
+
end
|
64
|
+
|
65
|
+
def disable_listen_thread?
|
66
|
+
case ENV['DISABLE_LISTEN_CHANGE_MONITORING']
|
67
|
+
when 'true', '1'
|
68
|
+
true
|
69
|
+
when 'false', '0'
|
70
|
+
false
|
71
|
+
when nil
|
72
|
+
service_env == 'test'
|
73
|
+
else
|
74
|
+
raise ArgumentError, "DISABLE_LISTEN_CHANGE_MONITORING has unknown value #{ENV['DISABLE_LISTEN_CHANGE_MONITORING'].inspect}"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
61
78
|
private
|
62
79
|
|
80
|
+
def service_env
|
81
|
+
(defined?(Rails) && Rails.environmnent) || ENV['SERVICE_ENV']
|
82
|
+
end
|
83
|
+
|
63
84
|
# Loads the most recent settings from disk
|
64
85
|
def load_untargeted_settings
|
65
86
|
new_untargeted_settings = load_file(file_path)
|