nutcracker 0.2.4.6 → 0.2.4.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/nutcracker.rb CHANGED
@@ -109,8 +109,9 @@ module Nutcracker
109
109
  # Adding cluster Node
110
110
  if node_value.kind_of? Hash
111
111
  url = ( node =~ /redis\:\/\// ) ? node : "redis://#{node}"
112
+ info = redis_info(url)
112
113
  cluster[:nodes] << {
113
- server_url: url, info: redis_info(url)
114
+ server_url: url, info: info, running: info.any?
114
115
  }.merge(cluster_data[node])
115
116
  else # Cluster attribute
116
117
  cluster[node] = node_value
@@ -127,7 +128,12 @@ module Nutcracker
127
128
  end
128
129
 
129
130
  def redis_info url
130
- redis = Redis.connect url: url
131
+ begin
132
+ redis = Redis.connect(url: url)
133
+ rescue
134
+ return Hash.new
135
+ end
136
+
131
137
  info = redis.info
132
138
  db_size = redis.dbsize
133
139
  max_memory = redis.config(:get, 'maxmemory')['maxmemory'].to_i
@@ -1,3 +1,3 @@
1
1
  module Nutcracker
2
- VERSION = "0.2.4.6"
2
+ VERSION = "0.2.4.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutcracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4.6
4
+ version: 0.2.4.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-01 00:00:00.000000000 Z
12
+ date: 2013-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -236,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
236
236
  version: '0'
237
237
  segments:
238
238
  - 0
239
- hash: -3036095687415925359
239
+ hash: 1477241173229409876
240
240
  requirements: []
241
241
  rubyforge_project: ruby-nutcracker
242
242
  rubygems_version: 1.8.25