govuk_app_config 9.18.1 → 9.19.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: ab40b8b4b0ecbf73887e3e946b57547fd8f68ba6e5f7da78a60052b2c44c6358
|
4
|
+
data.tar.gz: 65256f6a26e4173507dc4eb9c3d3805456bbe806df25e32f375eba1fb68f5b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 011b0b5dfe895521562348f134bf4d650d318420b0698213328ad5f1aed377baac4f4edf2c43002f22eeeccb16aedd9a3921a2a7c30ebbdbcbb670f4272913f7
|
7
|
+
data.tar.gz: b81b57c6775a1d9b9405e459ec4b53c9d91251627cd6e2aae52cb5f66a920a20f402be06c516104c71ba7fd6a752d04948578ed233eaf3c8b58ccd57e1ebecfd
|
data/CHANGELOG.md
CHANGED
data/docs/healthchecks.md
CHANGED
@@ -29,7 +29,9 @@ Built-in checks you can use include:
|
|
29
29
|
|
30
30
|
- `GovukHealthcheck::RailsCache` - checks that the Rails cache store, such as Memcached, is acessible by writing and reading back a cache entry called "healthcheck-cache".
|
31
31
|
|
32
|
-
- `GovukHealthcheck::Redis` - checks that the app can connect to Redis by writing and reading back a cache entry called "healthcheck
|
32
|
+
- `GovukHealthcheck::Redis` - checks that the app can connect to Redis by writing and reading back a cache entry called "healthcheck-<random_hex>".
|
33
|
+
|
34
|
+
- `GovukHealthcheck::EmergencyBannerRedis` - checks that the app can connect to the Redis instance which has the emergency banner config by writing and reading back a cache entry called "healthcheck-emergency-banner-<random_hex>".
|
33
35
|
|
34
36
|
- `GovukHealthcheck::Mongoid` - checks that the app has a connection to its Mongo database via Mongoid.
|
35
37
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require "securerandom"
|
2
|
+
|
3
|
+
module GovukHealthcheck
|
4
|
+
class EmergencyBannerRedis
|
5
|
+
def name
|
6
|
+
:emergency_banner_redis_connectivity
|
7
|
+
end
|
8
|
+
|
9
|
+
def status
|
10
|
+
client = ::Redis.new(
|
11
|
+
url: ENV["EMERGENCY_BANNER_REDIS_URL"],
|
12
|
+
reconnect_attempts: [0, 0.25], # Purposefully short since this is a healthcheck
|
13
|
+
)
|
14
|
+
|
15
|
+
key = "healthcheck-emergency-banner-#{SecureRandom.hex}"
|
16
|
+
|
17
|
+
client.set(key, "val")
|
18
|
+
client.get(key)
|
19
|
+
client.del(key)
|
20
|
+
|
21
|
+
client.close
|
22
|
+
|
23
|
+
GovukHealthcheck::OK
|
24
|
+
rescue StandardError
|
25
|
+
GovukHealthcheck::CRITICAL
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require "govuk_app_config/govuk_healthcheck/checkup"
|
2
2
|
require "govuk_app_config/govuk_healthcheck/active_record"
|
3
|
+
require "govuk_app_config/govuk_healthcheck/emergency_banner_redis"
|
3
4
|
require "govuk_app_config/govuk_healthcheck/mongoid"
|
4
5
|
require "govuk_app_config/govuk_healthcheck/rails_cache"
|
5
6
|
require "govuk_app_config/govuk_healthcheck/redis"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_app_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.
|
4
|
+
version: 9.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
@@ -364,6 +364,7 @@ files:
|
|
364
364
|
- lib/govuk_app_config/govuk_healthcheck.rb
|
365
365
|
- lib/govuk_app_config/govuk_healthcheck/active_record.rb
|
366
366
|
- lib/govuk_app_config/govuk_healthcheck/checkup.rb
|
367
|
+
- lib/govuk_app_config/govuk_healthcheck/emergency_banner_redis.rb
|
367
368
|
- lib/govuk_app_config/govuk_healthcheck/mongoid.rb
|
368
369
|
- lib/govuk_app_config/govuk_healthcheck/rails_cache.rb
|
369
370
|
- lib/govuk_app_config/govuk_healthcheck/redis.rb
|