haproxy-cluster 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/haproxy_cluster.rb +5 -5
- data/lib/haproxy_cluster/cli.rb +1 -1
- data/lib/haproxy_cluster/server.rb +0 -11
- data/lib/haproxy_cluster/version.rb +1 -1
- metadata +4 -4
data/lib/haproxy_cluster.rb
CHANGED
@@ -41,11 +41,11 @@ class HAProxyCluster
|
|
41
41
|
# This block would not return until every member of the cluster is available
|
42
42
|
# to serve requests.
|
43
43
|
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
def
|
44
|
+
# wait_until(1!=1){false} #=> true
|
45
|
+
# wait_until(1==1){true} #=> true
|
46
|
+
# wait_until(1..3){2} #=> true
|
47
|
+
# wait_until(true){sleep} #=> Timeout
|
48
|
+
def wait_until (condition, &code)
|
49
49
|
results = map(&code)
|
50
50
|
delay = 1.5
|
51
51
|
loop do
|
data/lib/haproxy_cluster/cli.rb
CHANGED
@@ -24,7 +24,7 @@ OptionParser.new do |opts|
|
|
24
24
|
options.timeout = o.to_f
|
25
25
|
end
|
26
26
|
opts.on_tail("--version", "Show version") do
|
27
|
-
puts HAProxyCluster::
|
27
|
+
puts HAProxyCluster::VERSION
|
28
28
|
exit
|
29
29
|
end
|
30
30
|
opts.on_tail "URL should be the root of an HA Proxy status page, either http:// or https://"
|
@@ -29,17 +29,6 @@ class HAProxyCluster
|
|
29
29
|
modify! :disable
|
30
30
|
end
|
31
31
|
|
32
|
-
def wait_until_ok
|
33
|
-
return true if self.ok?
|
34
|
-
start = Time.now
|
35
|
-
until self.ok?
|
36
|
-
raise Timeout if Time.now > start + 10
|
37
|
-
sleep 1
|
38
|
-
@member.poll!
|
39
|
-
end
|
40
|
-
return true
|
41
|
-
end
|
42
|
-
|
43
32
|
private
|
44
33
|
|
45
34
|
def modify! (how)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: haproxy-cluster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
|
-
requirement: &
|
16
|
+
requirement: &70257308044560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70257308044560
|
25
25
|
description: ! " Ruby Gem and command line tool for quickly answering questions like,
|
26
26
|
\"Can we\n survive a rolling restart?\", \"How many transactions per second am
|
27
27
|
I seeing?\",\n \"What's my session backlog?\". Intended for use within continuous
|