aggkit 0.4.8.19389 → 0.4.8.19621
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/aggwrap +45 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62b21d86611dd16abace3fc55548ed8e0de34bd5bb68b3e2f4bbc10bbcb8b610
|
4
|
+
data.tar.gz: ac83f17317ab2b62ac0650574de2bda400e7caef97c4c5ccbac38ad40208be0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9598e7efb861be2ac6883910d2bd1189b3d106be6102050d5a6c4fd65a18d49cf8fb14866d28c9aee9bf712002c11de3706defdaf42ca845722174a1b43f0c39
|
7
|
+
data.tar.gz: e9f5d35d0548fb1715c7f9ec70aa042db12463ff193407c3cfa94c4f3191d4ca80371744b15fa5436550c2ca94110546e27c699aeca0288949fd2a98ae61f044
|
data/Gemfile.lock
CHANGED
data/bin/aggwrap
CHANGED
@@ -234,38 +234,63 @@ end
|
|
234
234
|
|
235
235
|
Thread.abort_on_exception = true
|
236
236
|
|
237
|
+
def with_retry(count = 2)
|
238
|
+
begin
|
239
|
+
retries ||= 0
|
240
|
+
yield
|
241
|
+
rescue StandardError
|
242
|
+
if (retries += 1) < count
|
243
|
+
STDERR.puts "Retry #{retries}..."
|
244
|
+
retry
|
245
|
+
else
|
246
|
+
raise
|
247
|
+
end
|
248
|
+
end
|
249
|
+
end
|
250
|
+
|
251
|
+
def ensure_service_registered
|
252
|
+
with_retry(3) do
|
253
|
+
STDERR.puts "Ensure service #{@service} registered..."
|
254
|
+
raise "Registration failed by Diplomat" unless Diplomat::Service.register(@service, timeout: 10)
|
255
|
+
yield
|
256
|
+
end
|
257
|
+
rescue => e
|
258
|
+
die("Can't register service #{@service} in consul: #{e}")
|
259
|
+
end
|
260
|
+
|
237
261
|
Thread.new do
|
238
262
|
loop do
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
263
|
+
ensure_service_registered do
|
264
|
+
run_check(@checks[:exec]) do |check_id|
|
265
|
+
make_ttl_pass(check_id)
|
266
|
+
end
|
243
267
|
|
244
|
-
|
245
|
-
|
246
|
-
|
268
|
+
if @checks[:http]
|
269
|
+
run_check(@checks[:http]) do |check_id|
|
270
|
+
check_http(check_id, @opts[:http])
|
271
|
+
end
|
247
272
|
end
|
248
|
-
end
|
249
273
|
|
250
|
-
|
251
|
-
|
252
|
-
|
274
|
+
if @checks[:file]
|
275
|
+
run_check(@checks[:file]) do |check_id|
|
276
|
+
check_file(check_id, @opts[:file])
|
277
|
+
end
|
253
278
|
end
|
254
|
-
end
|
255
279
|
|
256
|
-
|
257
|
-
|
258
|
-
|
280
|
+
if @checks[:pidfile]
|
281
|
+
run_check(@checks[:pidfile]) do |check_id|
|
282
|
+
check_pidfile(check_id, @opts[:pidfile])
|
283
|
+
end
|
259
284
|
end
|
260
|
-
end
|
261
285
|
|
262
|
-
|
263
|
-
|
264
|
-
|
286
|
+
if @checks[:script]
|
287
|
+
run_check(@checks[:script]) do |check_id|
|
288
|
+
check_script(check_id, @opts[:script])
|
289
|
+
end
|
265
290
|
end
|
266
291
|
end
|
267
292
|
|
268
|
-
sleep rand(10..
|
293
|
+
sleep rand(10..29)
|
269
294
|
end
|
270
295
|
end
|
271
296
|
|
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.8.
|
4
|
+
version: 0.4.8.19621
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Godko Ivan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-11-
|
12
|
+
date: 2019-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diplomat
|