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 +4 -4
- data/lib/etcd-discovery/service.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b113e0d1fc9ae5ffb0251f0beca030dae80cb27c
|
4
|
+
data.tar.gz: a72656c507f6220cf70ca06a59f01b929614eb87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|