easymon 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/easymon/checks/redis_check.rb +9 -5
- data/lib/easymon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54cb530caec2412771ed64ef0e61841aa44e7794b2556b5549dca177b6118bfa
|
4
|
+
data.tar.gz: efd43b670a69577f16fd9a8ef83eb2748989c2a0992d07e5490d12290fdbd9e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b79e1a2b8c43fd58ae493a7bfaf780ba6ab5948237454ee0ab86db14e1c2bb8988617f8cf68d11164c2bf94bef7373be1a77be803a0de47cb0b7e3ad33fe74bb
|
7
|
+
data.tar.gz: 6190f08e784393b88c4d544b7385c66c3f25875ba35b0791f4abcd87b9481e2075bf8deddfef78b7b34db43687d11725cf753e556e16995bd42ab768fd72bfb2
|
@@ -3,11 +3,11 @@ require "redis"
|
|
3
3
|
module Easymon
|
4
4
|
class RedisCheck
|
5
5
|
attr_accessor :config
|
6
|
-
|
6
|
+
|
7
7
|
def initialize(config)
|
8
8
|
self.config = config
|
9
|
-
end
|
10
|
-
|
9
|
+
end
|
10
|
+
|
11
11
|
def check
|
12
12
|
check_status = redis_up?
|
13
13
|
if check_status
|
@@ -17,12 +17,16 @@ module Easymon
|
|
17
17
|
end
|
18
18
|
[check_status, message]
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
private
|
22
22
|
def redis_up?
|
23
23
|
redis = Redis.new(@config)
|
24
24
|
reply = redis.ping == 'PONG'
|
25
|
-
redis.close
|
25
|
+
if redis.respond_to? :close
|
26
|
+
redis.close # Redis 4+
|
27
|
+
else
|
28
|
+
redis.client.disconnect # Older redis
|
29
|
+
end
|
26
30
|
reply
|
27
31
|
rescue
|
28
32
|
false
|
data/lib/easymon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easymon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Anderson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|