redis_ha 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -64,12 +64,14 @@ private
64
64
  ret = Timeout::timeout(@read_timeout) do
65
65
  yield
66
66
  end
67
- rescue Redis::CannotConnectError
68
- mark_as_down; nil
69
- rescue Timeout::Error
70
- mark_as_down; nil
67
+ rescue Exception => e
68
+ @status = :down
69
+ @down_since = Time.now.to_f
70
+ return nil
71
71
  else
72
- mark_as_up; ret
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
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "redis_ha"
6
- s.version = "0.0.1"
6
+ s.version = "0.0.2"
7
7
  s.date = Date.today.to_s
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Paul Asmuth"]
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.1
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-13 00:00:00.000000000 Z
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: &19924060 !ruby/object:Gem::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: *19924060
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.