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 +4 -4
- data/lib/server_health_check.rb +12 -5
- data/lib/server_health_check/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dc4e8080d484f080a663bf1d38890e74c8fa7c7
|
4
|
+
data.tar.gz: e0b1779cbb2c1279e7d057d1d0eb3b596ead32d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70d5769ffa80ff01479b30ec388d4579b1eb6d01bcd01dce91e3abb083c93f592ec5f1263ca653878c3d9702ddc61b36974c792a00e675ef1d1349afde149eb4
|
7
|
+
data.tar.gz: 07f9897f73db9b4ecdf57920e2415487a5bfbf7e3798a4142de37b3469e46fd5f3d7426bcef138d726324e8d2cc4916cbecb665df97276ff9d0aa32dcfb47105
|
data/lib/server_health_check.rb
CHANGED
@@ -24,11 +24,18 @@ class ServerHealthCheck
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def active_record!
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
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.
|
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-
|
11
|
+
date: 2017-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|