katalyst-healthcheck 0.4.0 → 0.5.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 +4 -4
- data/lib/katalyst/healthcheck/store/redis.rb +10 -7
- data/lib/katalyst/healthcheck/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: d2c5ddb6e887d5d12b30fe4cddc3856222443b046aff435ed75f2c27f25ff9db
|
4
|
+
data.tar.gz: 3c212412d7e98d446339d3863a8b7b17fbbec35cff3add2bfce5def17a33b11d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10cf918ad7774608219e8740296293ba6adec792a423ad2111184c60bcbb1cd12f97256fc4b554e2a0c62959ea9865cde0dabe5c68ae67b19753cd1956d06048
|
7
|
+
data.tar.gz: 44a7a6ef7865a3d69e2c823e811e1408f2d29cae236715c199392c55ca761c065209864464adc2af442fa79b812ae31fb03a8572d235697f931b4b75a06280b3
|
@@ -9,8 +9,8 @@ module Katalyst
|
|
9
9
|
class Redis
|
10
10
|
DEFAULT_CACHE_KEY = "katalyst_healthcheck_tasks"
|
11
11
|
MAX_WRITE_TIME = 5000 # milliseconds
|
12
|
-
DEFAULT_HOST = "localhost"
|
13
|
-
DEFAULT_PORT = 6379
|
12
|
+
DEFAULT_HOST = ENV.fetch("DEFAULT_REDIS_HOST", "localhost")
|
13
|
+
DEFAULT_PORT = ENV.fetch("DEFAULT_REDIS_PORT", "6379")
|
14
14
|
DEFAULT_OPTIONS = {
|
15
15
|
url: "redis://#{DEFAULT_HOST}:#{DEFAULT_PORT}",
|
16
16
|
cache_key: DEFAULT_CACHE_KEY,
|
@@ -19,10 +19,12 @@ module Katalyst
|
|
19
19
|
class << self
|
20
20
|
# @return [String] Redis URL defined in rails config
|
21
21
|
def rails_redis_url
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
ENV.fetch("REDIS_URL") do
|
23
|
+
redis_config = rails_redis_config || {}
|
24
|
+
host = redis_config["host"] || DEFAULT_HOST
|
25
|
+
port = redis_config["port"] || DEFAULT_PORT
|
26
|
+
"redis://#{host}:#{port}"
|
27
|
+
end
|
26
28
|
end
|
27
29
|
|
28
30
|
def rails_redis_config
|
@@ -38,7 +40,8 @@ module Katalyst
|
|
38
40
|
def initialize(options = {})
|
39
41
|
options = { url: self.class.rails_redis_url }.merge(options) if defined?(Rails)
|
40
42
|
options = DEFAULT_OPTIONS.merge(options)
|
41
|
-
|
43
|
+
namespaced_cache_key = [ENV["RAILS_ENV"], options[:cache_key]].compact.join("_")
|
44
|
+
@options = Struct.new(:url, :cache_key).new(options[:url], namespaced_cache_key)
|
42
45
|
end
|
43
46
|
|
44
47
|
# @return [Array<Hash>] List of tasks attribute data
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: katalyst-healthcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katalyst Interactive
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|