Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
3456ff2b
Unverified
Commit
3456ff2b
authored
2 years ago
by
Jesus Federico
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GIT-XX: making health check conditiopns configurable (#4823)
parent
b99c7654
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/health_check_controller.rb
+3
-3
3 additions, 3 deletions
app/controllers/health_check_controller.rb
config/application.rb
+4
-0
4 additions, 0 deletions
config/application.rb
sample.env
+10
-0
10 additions, 0 deletions
sample.env
with
17 additions
and
3 deletions
app/controllers/health_check_controller.rb
+
3
−
3
View file @
3456ff2b
...
...
@@ -26,9 +26,9 @@ class HealthCheckController < ApplicationController
@cache_expire
=
10
.
seconds
begin
cache_check
database_check
email_check
cache_check
if
Rails
.
configuration
.
health_check_cache_enabled
database_check
if
Rails
.
configuration
.
health_check_db_enabled
email_check
if
Rails
.
configuration
.
health_check_email_enabled
rescue
=>
e
response
=
"Health Check Failure:
#{
e
}
"
end
...
...
This diff is collapsed.
Click to expand it.
config/application.rb
+
4
−
0
View file @
3456ff2b
...
...
@@ -188,5 +188,9 @@ module Greenlight
config
.
max_avatar_size
=
ENV
[
'MAX_AVATAR_SIZE'
].
to_i
.
zero?
?
100_000
:
ENV
[
'MAX_AVATAR_SIZE'
].
to_i
config
.
social_switching
=
ENV
[
'SOCIAL_SWITCHING'
]
==
"true"
config
.
health_check_cache_enabled
=
ENV
.
fetch
(
'ENABLE_HEALTH_CHECK_CACHE'
,
'true'
).
casecmp?
(
'true'
)
config
.
health_check_db_enabled
=
ENV
.
fetch
(
'ENABLE_HEALTH_CHECK_DB'
,
'true'
).
casecmp?
(
'true'
)
config
.
health_check_email_enabled
=
ENV
.
fetch
(
'ENABLE_HEALTH_CHECK_EMAIL'
,
'true'
).
casecmp?
(
'true'
)
end
end
This diff is collapsed.
Click to expand it.
sample.env
+
10
−
0
View file @
3456ff2b
...
...
@@ -371,3 +371,13 @@ MAX_AVATAR_SIZE=100000
# Due CCVE-2015-9284, this setting needs to be enabled for omniauth to respond GET requests.
# ENABLE_OMNIAUTH_GET=true|<false>
ENABLE_OMNIAUTH_GET=false
# By default health_check proves the availability of CACHE, DB and EMAIL server
# but when the time of response requires is highly sensitive, in some cases it is necessary to disable
# them and relay only on the http response. In such case these env variables can be set.
# ENABLE_HEALTH_CHECK_CACHE=<true>|false
# ENABLE_HEALTH_CHECK_DB=<true>|false
# ENABLE_HEALTH_CHECK_EMAIL=<true>|false
ENABLE_HEALTH_CHECK_CACHE=true
ENABLE_HEALTH_CHECK_DB=true
ENABLE_HEALTH_CHECK_EMAIL=true
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment