easymon 1.4.1 → 1.4.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
  SHA256:
3
- metadata.gz: bf76cc1300dbf7f7d26a222de5a63bd5e33aebbe3b46309cebb3d57c56a96198
4
- data.tar.gz: 6dba2bf0de1364f1654eabeee1d77dab1f56468da147d5deebced8d5d4b8cd0c
3
+ metadata.gz: 54cb530caec2412771ed64ef0e61841aa44e7794b2556b5549dca177b6118bfa
4
+ data.tar.gz: efd43b670a69577f16fd9a8ef83eb2748989c2a0992d07e5490d12290fdbd9e4
5
5
  SHA512:
6
- metadata.gz: d291eb62ea6e290218df03a25952fff04de375f70c1c83d5c354cca6ce388a384af352ad4e6297702c8f84346cb2f943c3d139f26df8033f25679ab0bc0713c3
7
- data.tar.gz: 39c8f3667f94968c025790bf5e5745116ae8c3aaf6e679ce4a5b1a37554193564094d954e101fe5a7e0f4ab54fc7176a393d42a9b441ee8023454e52c3ea1545
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
@@ -1,3 +1,3 @@
1
1
  module Easymon
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
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.1
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-09 00:00:00.000000000 Z
11
+ date: 2018-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis