health-monitor-rails 12.7.0 → 12.8.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f3b4c61cf155dd625c75164d323fb8cf21392c6cc2556dae81ac2c5c9a0152b
|
4
|
+
data.tar.gz: a5722b7cf95b7cb2d1984b3298cccc2cee2233737c51dea82081206db4f5c38d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73ab03b04571b3b2de5b6bbfa82566c1364b0656a5396144279dcd473e7531ba2e73d1f0e66e1ba8c4745f6353185772ab594a90d6195417930aa38da0816030
|
7
|
+
data.tar.gz: 85f64ff43e77be067ec39c4a3643647cd52832c08e36b34fc09501da1dd45ad4e8b38afd300c309e03a2583bf72841750a5a2d70f90fa3cf85cc2ca41c7de3ec
|
@@ -7,10 +7,12 @@ module HealthMonitor
|
|
7
7
|
class CacheException < StandardError; end
|
8
8
|
|
9
9
|
class Cache < Base
|
10
|
+
EXPIRED_TIME_SECONDS = 3
|
11
|
+
|
10
12
|
def check!
|
11
13
|
time = Time.now.to_formatted_s(:rfc2822)
|
12
14
|
|
13
|
-
Rails.cache.write(key, time)
|
15
|
+
Rails.cache.write(key, time, expires_in: EXPIRED_TIME_SECONDS)
|
14
16
|
fetched = Rails.cache.read(key)
|
15
17
|
|
16
18
|
raise "different values (now: #{time}, fetched: #{fetched})" if fetched != time
|
@@ -9,6 +9,8 @@ module HealthMonitor
|
|
9
9
|
class RedisException < StandardError; end
|
10
10
|
|
11
11
|
class Redis < Base
|
12
|
+
EXPIRED_TIME_SECONDS = 3
|
13
|
+
|
12
14
|
class Configuration < Base::Configuration
|
13
15
|
DEFAULT_URL = nil
|
14
16
|
|
@@ -45,7 +47,7 @@ module HealthMonitor
|
|
45
47
|
def check_values!
|
46
48
|
time = Time.now.to_formatted_s(:rfc2822)
|
47
49
|
|
48
|
-
redis.with { |conn| conn.set(key, time) }
|
50
|
+
redis.with { |conn| conn.set(key, time, ex: EXPIRED_TIME_SECONDS) }
|
49
51
|
fetched = redis.with { |conn| conn.get(key) }
|
50
52
|
|
51
53
|
raise "different values (now: #{time}, fetched: #{fetched})" if fetched != time
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: health-monitor-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 12.
|
4
|
+
version: 12.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leonid Beder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-04-
|
11
|
+
date: 2025-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|