katalyst-healthcheck 0.3.0 → 0.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 598b8c8ff9cd98a080eca3ec50b04b3b6e4ecd9cbf77d2db2b727264eaf724fc
|
4
|
+
data.tar.gz: 1d9263a7f9ace6ecb1e85004152e67641b259cfcfdbd50c371b2969593a32a6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 942c06bb7d5508509bf6682dd484ceb48b6e11bc6c0f9130372c88285c08bbae5f0ef7603a5ad2e7d37e1005265075b0b694ce55ac11fb7504ca81745ae8016d
|
7
|
+
data.tar.gz: bcd5e63980bc900e04d5dccc5ad9c00a554b248fd0917dfeb054a6b20297288e35110414492fb96258a32290a803d3bfb6292f6bb5337a174cb4843b44e33327
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ the `Katalyst::Healthcheck::Monitored` concern's `healthy!` and `unhealthy` meth
|
|
58
58
|
``` ruby
|
59
59
|
include Katalyst::Healthcheck::Monitored
|
60
60
|
|
61
|
-
|
61
|
+
define_healthcheck_task :my_task, "My task description", interval: 1.day
|
62
62
|
|
63
63
|
def do_task
|
64
64
|
... task code here ...
|
@@ -12,9 +12,10 @@ module Katalyst
|
|
12
12
|
# @param name [Symbol] The name of the task
|
13
13
|
# @param description [String] A description of the task's function
|
14
14
|
# @param interval [Integer,ActiveSupport::Duration] Expected frequency that this task runs, e.g. 1.day
|
15
|
-
def
|
15
|
+
def define_healthcheck_task(name, description, interval:)
|
16
16
|
defined_healthcheck_tasks[name] = Task.new(name: name, description: description, interval: interval)
|
17
17
|
end
|
18
|
+
alias define_task define_healthcheck_task
|
18
19
|
|
19
20
|
# @return [Hash] Defined tasks keyed by name
|
20
21
|
def defined_healthcheck_tasks
|
@@ -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
|
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.4.1
|
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-
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
- !ruby/object:Gem::Version
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.3.15
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Health check routes and functions
|