etcd-discovery 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: 1b8a43d02a8039190280e3339fc2a75e0bf17a6f
4
- data.tar.gz: fd06a67c3c878a3a0732ba5362b804fae70b4cd6
3
+ metadata.gz: b113e0d1fc9ae5ffb0251f0beca030dae80cb27c
4
+ data.tar.gz: a72656c507f6220cf70ca06a59f01b929614eb87
5
5
  SHA512:
6
- metadata.gz: db73871e90d971d6bdc2cdeccf5499df32392536b716b188dc1087b340fa7d7c8fdd987fa7cf5ed18bcc3ce45dad55d3ccbc4f09ed004343200835e6219017d1
7
- data.tar.gz: f6a0ec5790eaa580e4f168b54c1d78b6bf08850228e78872f320e33ea2d0cb8fcc60d2c9647d28dbc71efcb190d1722ce8f2a882ba4b1990396402f5180f1272
6
+ metadata.gz: cb10c238f437eba20e3b011f2cfe3a9e9acaa05237cf70cecb6f26cc4ca84db4a82d2f48a8b7ca37f26dcd35ee57a583f5fff1bad2787ef9c7c5ae592624f95a
7
+ data.tar.gz: 4761be1d7cc4fe0eddeb0984e41edf3590403a27a07f5c9654d840e6c7a2b4421e142645cf4431d884e24a31042eafcef2b282fa5542952a4f82ebc749821f0f
@@ -35,9 +35,14 @@ module EtcdDiscovery
35
35
  config = EtcdDiscovery.config
36
36
  client = config.client
37
37
  value = h.to_json
38
+ key_name = "/services/#{service}/#{h.attributes['name']}"
38
39
 
39
40
  while true
40
- client.set("/services/#{service}/#{h.attributes['name']}", value: value, ttl: config.register_ttl)
41
+ begin
42
+ client.set(key_name, value: value, ttl: config.register_ttl)
43
+ rescue => e
44
+ puts "Fail to set #{key_name}: #{e}, #{e.message}, #{e.class}"
45
+ end
41
46
  sleep config.register_renew
42
47
  end
43
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etcd-discovery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Léo Unbekandt