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: c7784c42fe43339752201acf900892cf379bf233b811aaaebc31c1ccddc0ac3b
4
- data.tar.gz: 3ce81d17b8d152dff01b1a32b42ca51bb0c9b35e33dc3a4340d962a29b811b2a
3
+ metadata.gz: 1f8e392cd400da90240ba36f891533ba6fedd9eb8be77f26fb6f15eefa2c7a52
4
+ data.tar.gz: 3033901b63c1323202efe06ae13b29f349429d6122767835cb28c9862426bca1
5
5
  SHA512:
6
- metadata.gz: b99401c0647e240e7c092f5e93a9f3019f7ce35a478647bd3eef303801b947f297ae4d30607957232b68c7d1bbd39f5bc011bdee102ddf645da031523d7b1f21
7
- data.tar.gz: 9369ddb6fc827a00af76fcbebeb94d9b6d6bb529b075018b11e6c8bbe860435f25c260e125c57c608347dbc48712489143d84844ef760bd94c1b18194b4e5336
6
+ metadata.gz: 1991d19cf1a94958fe8b6123092b9d767cb075e97009384b41b419ec74138f6db079a18e8e88861d4008cfbcf5973392ddc5b411ae115560863463c3286874a5
7
+ data.tar.gz: 16f6d856efc305599428966ed39ddb05550f2077951fc0b9bc4e4ec5554252cfe98dce0eb476c9706f57e923a03375808bec728e40860e2970615088d5da60cd
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EurekaRuby
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
@@ -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
- Rails.logger.error(error_text)
34
- NewRelic::Agent.notice_error(error_text) if defined?(NewRelic)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eureka_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - 乌托邦科技