synapse-easy 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/synapse/easy/service.rb +13 -0
- data/lib/synapse/easy/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2630252dfaab4dcfff47b93334d950df0a00723
|
4
|
+
data.tar.gz: 585be6f8f0aafb55818fa59484f047bab2b43234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9dfdca7428ca4bc8dddd7fa565e150494c7d5f4f8d6bdf9d38fbb00feba8355c3d3a729ad587388e653cc65c2f23702a0f6d642d8faaa6b21afadbb93826303
|
7
|
+
data.tar.gz: 959c41b0b24ee0702c59c60ca6da329184a9d0cd95d6b30bd3e4d4da0aad6c262e0a83f4120abdedabdcd8f8aca34a206c6e8b0388783891c385527b2ec5dce2
|
data/lib/synapse/easy/service.rb
CHANGED
@@ -2,6 +2,7 @@ require "freeport"
|
|
2
2
|
require "resolv/consul"
|
3
3
|
require "active_support/core_ext/hash/indifferent_access"
|
4
4
|
require "fake/hash"
|
5
|
+
require "socket"
|
5
6
|
|
6
7
|
module Synapse
|
7
8
|
module Easy
|
@@ -123,6 +124,18 @@ module Synapse
|
|
123
124
|
def to_uri
|
124
125
|
URI to_s()
|
125
126
|
end
|
127
|
+
def check
|
128
|
+
begin
|
129
|
+
socket = TCPSocket.new(host.to_s,port.to_i)
|
130
|
+
rescue Errno::ECONNREFUSED
|
131
|
+
sleep 0.1
|
132
|
+
retry
|
133
|
+
ensure
|
134
|
+
socket.close
|
135
|
+
return true
|
136
|
+
end
|
137
|
+
return false
|
138
|
+
end
|
126
139
|
end
|
127
140
|
end
|
128
141
|
end
|
data/lib/synapse/easy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synapse-easy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Kaufmann
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: resolv-consul
|
@@ -128,3 +128,4 @@ signing_key:
|
|
128
128
|
specification_version: 4
|
129
129
|
summary: Synapse Config Generator for HAProxy and Services.
|
130
130
|
test_files: []
|
131
|
+
has_rdoc:
|