-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MET-425 Create a common healthcheck plugin for public and private endpoints #220
Conversation
|
||
if (opts.healthChecks.length) { | ||
const results = await Promise.all( | ||
opts.healthChecks.map(async (healthcheck) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mixing async/await and callbacks is often not the best idea, I would recommend to keep the original style of
opts.healthChecks.map((healthcheck) => {
return healthcheck.checker(app).then((result) => {
if (result.error) {
app.log.error(result.error, `${healthcheck.name} healthcheck has failed`)
}
return {
name: healthcheck.name,
result,
isMandatory: healthcheck.isMandatory,
}
})
}),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted in 4306cba
@andrewi-wd should this be a breaking change (semver major)? |
@kibertoad I don't think so. I haven't modified existing healthcheck that is used, so there must be no problem with updates. |
Changes
This PR adds a new
commonHealthcheckPlugin
, which is registering two routes:GET /
GET /health
Public route contain only resulting heartbeat from all provided healthchecks in a response. Extra info is also omitted.
Private route contain exactly the same response as
publicHealthcheckPlugin
has.Checklist
major
,minor
,patch
orskip-release