eureka_ruby 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f8e392cd400da90240ba36f891533ba6fedd9eb8be77f26fb6f15eefa2c7a52
|
4
|
+
data.tar.gz: 3033901b63c1323202efe06ae13b29f349429d6122767835cb28c9862426bca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1991d19cf1a94958fe8b6123092b9d767cb075e97009384b41b419ec74138f6db079a18e8e88861d4008cfbcf5973392ddc5b411ae115560863463c3286874a5
|
7
|
+
data.tar.gz: 16f6d856efc305599428966ed39ddb05550f2077951fc0b9bc4e4ec5554252cfe98dce0eb476c9706f57e923a03375808bec728e40860e2970615088d5da60cd
|
data/lib/eureka_ruby/version.rb
CHANGED
@@ -27,12 +27,17 @@ if ENV['EUREKA']
|
|
27
27
|
response = EurekaRuby.executor.run(:send_heartbeat)
|
28
28
|
next if [200, 204].include? response.status
|
29
29
|
|
30
|
-
EurekaRuby.executor.run(:register) if response.status == 404
|
31
|
-
|
32
30
|
error_text = "发送心跳到 Eureka 失败: status: #{response.status} body: #{response.body.to_s}"
|
33
|
-
|
34
|
-
|
31
|
+
|
32
|
+
EurekaRuby.executor.run(:register) if response.status == 404
|
33
|
+
rescue => ex
|
34
|
+
error_text = "发送心跳到 Eureka 失败: #{ex.message}\n#{ex.backtrace.join("\n")}"
|
35
35
|
ensure
|
36
|
+
if error_text
|
37
|
+
Rails.logger.error(error_text)
|
38
|
+
NewRelic::Agent.notice_error(error_text) if defined?(NewRelic)
|
39
|
+
end
|
40
|
+
|
36
41
|
sleep ENV.fetch('EUREKA_HEARTBEAT_PERIOD', 5).to_i
|
37
42
|
end
|
38
43
|
end
|