server_health_check 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1980c0a16cbdaca5e280995a96ee9d5f185b4389
4
- data.tar.gz: 4f06712ed902413536a8207ecc106feab43b261f
3
+ metadata.gz: 6dc4e8080d484f080a663bf1d38890e74c8fa7c7
4
+ data.tar.gz: e0b1779cbb2c1279e7d057d1d0eb3b596ead32d0
5
5
  SHA512:
6
- metadata.gz: b26ab14fc7a1cbd14d91da86f6ad6b91892024604f0aae73247b3a8e1bc6f57711c29660dd2b4d320a2d1cc49887b12a3857cc780f143e8fa8662f7b41a46d17
7
- data.tar.gz: 6393cb1717860463f731797b28886e1129a377b0948612ed23f9f43d3d4406e668875266a6089166c6491abb06a36bbbfba0c46537fe0b9f7dfa2627d0b2359c
6
+ metadata.gz: 70d5769ffa80ff01479b30ec388d4579b1eb6d01bcd01dce91e3abb083c93f592ec5f1263ca653878c3d9702ddc61b36974c792a00e675ef1d1349afde149eb4
7
+ data.tar.gz: 07f9897f73db9b4ecdf57920e2415487a5bfbf7e3798a4142de37b3469e46fd5f3d7426bcef138d726324e8d2cc4916cbecb665df97276ff9d0aa32dcfb47105
@@ -24,11 +24,18 @@ class ServerHealthCheck
24
24
  end
25
25
 
26
26
  def active_record!
27
- if ActiveRecord::Base.connected?
28
- @results[:active_record] = OK
29
- true
30
- else
31
- @results[:active_record] = "Failed: unable to connect to database"
27
+ begin
28
+ if ActiveRecord::Base.connection_pool.with_connection { |connection| connection.active? }
29
+ @results[:active_record] = OK
30
+ true
31
+ else
32
+ @results[:active_record] = "Failed: unable to connect to database"
33
+ false
34
+ end
35
+ rescue NameError
36
+ raise
37
+ rescue StandardError => e
38
+ @results[:active_record] = "Failed: error while connecting to database"
32
39
  false
33
40
  end
34
41
  end
@@ -1,3 +1,3 @@
1
1
  class ServerHealthCheck
2
- VERSION = "1.0.1".freeze
2
+ VERSION = "1.0.2".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server_health_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Quenten Griffith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-03 00:00:00.000000000 Z
11
+ date: 2017-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler