redis_ha 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/redis_ha/connection.rb +7 -16
- data/redis_ha.gemspec +1 -1
- metadata +4 -4
data/lib/redis_ha/connection.rb
CHANGED
@@ -64,12 +64,14 @@ private
|
|
64
64
|
ret = Timeout::timeout(@read_timeout) do
|
65
65
|
yield
|
66
66
|
end
|
67
|
-
rescue
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
rescue Exception => e
|
68
|
+
@status = :down
|
69
|
+
@down_since = Time.now.to_f
|
70
|
+
return nil
|
71
71
|
else
|
72
|
-
|
72
|
+
@down_since = nil if @status != :up
|
73
|
+
@status = :up
|
74
|
+
return ret
|
73
75
|
end
|
74
76
|
|
75
77
|
def up_or_retry?
|
@@ -81,16 +83,5 @@ private
|
|
81
83
|
false
|
82
84
|
end
|
83
85
|
|
84
|
-
def mark_as_down
|
85
|
-
@status = :down
|
86
|
-
@down_since = Time.now.to_f
|
87
|
-
end
|
88
|
-
|
89
|
-
def mark_as_up
|
90
|
-
return if @status == :up
|
91
|
-
@status = :up
|
92
|
-
@down_since = nil
|
93
|
-
end
|
94
|
-
|
95
86
|
end
|
96
87
|
|
data/redis_ha.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_ha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
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-11-
|
12
|
+
date: 2012-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
16
|
-
requirement: &
|
16
|
+
requirement: &14862340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 2.2.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *14862340
|
25
25
|
description: Three basic CRDTs (set, hashmap and counter) for redis. Also includes
|
26
26
|
a ConnectionPool that allows you to run concurrent redis commands on multiple connections
|
27
27
|
w/o using eventmachine/em-hiredis.
|