aggkit 0.4.5.12301 → 0.4.5.12324
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/aggwrap +7 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07ad58f9763727362844598bc0abc30902482bf7
|
4
|
+
data.tar.gz: 416a0f844d1670c7f1c2784fba6c363fa24805bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bf4bff4e30bfe1d9191e771e90b0f4b2cc776c093d54f8c83503eec42b942f1df8916712c0f896818190f825053dfba43c283f2f04fa7aafec9f9fbb75e3f98
|
7
|
+
data.tar.gz: 98c75882b30b5b740d7f1e578ee2bc5120d61be8367f3d17b243daa40bf946dfe43f3fa4e07931e772bc92968f12f4f2df0e22d45e9f748c37a92e9d8b9cf5ab
|
data/bin/aggwrap
CHANGED
@@ -67,9 +67,9 @@ if ENV['CONSUL_HTTP_ADDR'].to_s.empty?
|
|
67
67
|
end
|
68
68
|
|
69
69
|
@opts = {
|
70
|
-
service:
|
71
|
-
id:
|
72
|
-
consul:
|
70
|
+
service: ENV['AGGREDATOR_SERVICE'],
|
71
|
+
id: "#{Time.now.utc.strftime('%FT%T%z')}_#{SecureRandom.hex(2)}",
|
72
|
+
consul: ENV['CONSUL_HTTP_ADDR'],
|
73
73
|
reload_interval: DEFAULT_RELOAD_INTERVAL
|
74
74
|
}
|
75
75
|
|
@@ -121,7 +121,6 @@ parser = Aggkit::OptionParser.new do |o|
|
|
121
121
|
o.on('--reload-config-interval <INTERVAL>', 'Seconds between check change service configuration') do |interval|
|
122
122
|
@opts[:reload_interval] = Integer(interval)
|
123
123
|
end
|
124
|
-
|
125
124
|
end
|
126
125
|
parser.parse!
|
127
126
|
|
@@ -194,10 +193,12 @@ if @opts[:script]
|
|
194
193
|
end
|
195
194
|
|
196
195
|
def make_ttl_pass(check_id, output = nil)
|
196
|
+
output = "#{Time.now.utc}\n#{output}"
|
197
197
|
STDERR.puts "TTL call failed: #{check_id}" unless Diplomat::Check.pass(check_id, output)
|
198
198
|
end
|
199
199
|
|
200
200
|
def make_ttl_fail(check_id, output = nil)
|
201
|
+
output = "#{Time.now.utc}\n#{output}"
|
201
202
|
STDERR.puts "TTL call failed: #{check_id}" unless Diplomat::Check.fail(check_id, output)
|
202
203
|
end
|
203
204
|
|
@@ -283,7 +284,7 @@ end
|
|
283
284
|
|
284
285
|
|
285
286
|
Thread.new(@opts[:reload_interval], @opts[:service]) do |sleep_interval, service_name|
|
286
|
-
kv_prefix = [
|
287
|
+
kv_prefix = %w[services env]
|
287
288
|
config_hash = nil
|
288
289
|
service_kv_path = kv_prefix.append(service_name).join('/')
|
289
290
|
loop do
|
@@ -294,7 +295,7 @@ Thread.new(@opts[:reload_interval], @opts[:service]) do |sleep_interval, service
|
|
294
295
|
next if service_data.nil?
|
295
296
|
new_hash = Digest::MD5.new.update(service_data.to_json).hexdigest
|
296
297
|
if !config_hash.nil? && config_hash != new_hash
|
297
|
-
die(
|
298
|
+
die('Change kv configuration for consul service.')
|
298
299
|
end
|
299
300
|
config_hash = new_hash
|
300
301
|
end
|