aggkit 0.4.5.12301 → 0.4.5.12324

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/aggwrap +7 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 26fa6bda6378df5c2c899118bb2fd76f9ff438f7
4
- data.tar.gz: 82693d68d13a5c23d975d07f8447081bce11cb5a
3
+ metadata.gz: 07ad58f9763727362844598bc0abc30902482bf7
4
+ data.tar.gz: 416a0f844d1670c7f1c2784fba6c363fa24805bf
5
5
  SHA512:
6
- metadata.gz: df631a0eb56307cdc0d1bdc9e2c040764d6e66ed2327c5bf348f4d076e55ea599bc0f9fc4e0b8e145a365a35c49ddb708bd262b62ae3f223b4ac97780c53955d
7
- data.tar.gz: ab2220b1f2cd779dad19b32117bd1617ac62af8bf1925dbe28cb684f9bce8cad61fb8d97e3c1b4350f6037304304b2f39201612a23fa8c150416967268514c2f
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: ENV['AGGREDATOR_SERVICE'],
71
- id: SecureRandom.hex(8),
72
- consul: ENV['CONSUL_HTTP_ADDR'],
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 = ['services', 'env']
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("Change kv configuration for consul service.")
298
+ die('Change kv configuration for consul service.')
298
299
  end
299
300
  config_hash = new_hash
300
301
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aggkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5.12301
4
+ version: 0.4.5.12324
5
5
  platform: ruby
6
6
  authors:
7
7
  - Godko Ivan