health_check 2.6.0 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,5 +1,7 @@
1
1
  = Change Log =
2
2
 
3
+ * 2.7.0
4
+ * Add ability to check health of redis when url is non-standard redis url
3
5
  * 2.6.0
4
6
  * Add named custom checks
5
7
  * 2.5.0
@@ -138,6 +138,9 @@ To change the configuration of health_check, create a file `config/initializers/
138
138
 
139
139
  # http status code used when the ip is not allowed for the request
140
140
  config.http_status_for_ip_whitelist_error = 403
141
+
142
+ # When redis url is non-standard
143
+ config.redis_url = 'redis_url'
141
144
  end
142
145
 
143
146
  You may call add_custom_check multiple times with different tests. These tests will be included in the default list ("standard").
@@ -63,6 +63,10 @@ module HealthCheck
63
63
 
64
64
  mattr_accessor :installed_as_middleware
65
65
 
66
+ # Allow non-standard redis url
67
+ mattr_accessor :redis_url
68
+ self.redis_url = 'redis://localhost:6379/0'
69
+
66
70
  def self.add_custom_check(name = 'custom', &block)
67
71
  custom_checks[name] ||= [ ]
68
72
  custom_checks[name] << block
@@ -6,7 +6,7 @@ module HealthCheck
6
6
  unless defined?(::Redis)
7
7
  raise "Wrong configuration. Missing 'redis' gem"
8
8
  end
9
- res = ::Redis.new.ping
9
+ res = ::Redis.new(url: HealthCheck.redis_url).ping
10
10
  res == 'PONG' ? '' : "Redis.ping returned #{res.inspect} instead of PONG"
11
11
  rescue Exception => e
12
12
  create_error 'redis', e.message
@@ -1,3 +1,3 @@
1
1
  module HealthCheck
2
- VERSION = "2.6.0"
2
+ VERSION = "2.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: health_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.7.0
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: 2016-12-07 00:00:00.000000000 Z
12
+ date: 2017-10-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  requirements: []
143
143
  rubyforge_project:
144
- rubygems_version: 1.8.25
144
+ rubygems_version: 1.8.23.2
145
145
  signing_key:
146
146
  specification_version: 3
147
147
  summary: Simple health check of Rails app for uptime monitoring with Pingdom, NewRelic,