ruby_skynet 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_skynet/common.rb +1 -1
- data/lib/ruby_skynet/version.rb +1 -1
- data/lib/ruby_skynet/zookeeper/service_registry.rb +9 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fd7fd4822334e7d782d4dea66adfebee81ed5e6
|
4
|
+
data.tar.gz: df2655971d950f5672beadbbe324e866b24ef754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c40532f7c7ba9710f1aa48ee5f25fa1a6c1e0a4a1e2fb42d265309abb959e02a0dc1d40c5eada990cb0907898a04806540a1a39d3cd02e1bb2e2065ef12a4325
|
7
|
+
data.tar.gz: 1d877ccc14a6a71bd708161722e45aefbd5b529f9fc62ad6a20f4f7d393d231e4d9f808a849033b8cbfe7a79ecafe0065a65315921c34023c458beaf601a727c
|
data/lib/ruby_skynet/common.rb
CHANGED
@@ -27,7 +27,7 @@ module RubySkynet
|
|
27
27
|
|
28
28
|
# Returns the local ip address being used by this machine to talk to the
|
29
29
|
# internet. By default connects to Google and determines what IP Address is used locally
|
30
|
-
def self.local_ip_address(remote_ip = '
|
30
|
+
def self.local_ip_address(remote_ip = 'google.com')
|
31
31
|
@@local_ip_address ||= ::UDPSocket.open {|s| s.connect(remote_ip, 1); s.addr.last }
|
32
32
|
end
|
33
33
|
|
data/lib/ruby_skynet/version.rb
CHANGED
@@ -117,26 +117,23 @@ module RubySkynet
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
# Service information
|
120
|
+
# Service information created
|
121
121
|
def service_info_created(path, value=nil)
|
122
122
|
logger.info("service_info_created: #{path}", value)
|
123
123
|
# path: "uuid/key"
|
124
124
|
uuid, key = path.split('/')
|
125
125
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
logger.warn "Registered notification received for #{uuid} but is missing critical information. Received:", server
|
134
|
-
end
|
135
|
-
else
|
136
|
-
(@notifications_cache[uuid] ||= ThreadSafe::Hash.new)[key] = value
|
126
|
+
server = (@notifications_cache[uuid] ||= ThreadSafe::Hash.new)
|
127
|
+
server[key] = value
|
128
|
+
|
129
|
+
# Check if service is 'registered' and has all required attributes
|
130
|
+
if (server['registered'] == true) && server['addr'] && server['name'] && server['version'] && server['region']
|
131
|
+
hostname, port = server['addr'].split(':')
|
132
|
+
add_server(File.join(server['name'], server['version'].to_s, server['region']), hostname, port)
|
137
133
|
end
|
138
134
|
end
|
139
135
|
|
136
|
+
# Service information changed
|
140
137
|
def service_info_updated(path, value=nil)
|
141
138
|
logger.info("service_info_updated: #{path}", value)
|
142
139
|
# path: "uuid/key"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_skynet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reid Morrison
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07
|
11
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic_logger
|