rename getCurrent -> getMostRecent
This commit is contained in:
parent
70fd6b0f8f
commit
394ae44aa9
|
@ -16,7 +16,7 @@ function getStatusCode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// grab the most recent critical entry element from DB
|
// grab the most recent critical entry element from DB
|
||||||
const entry = getCurrentCriticalEntry();
|
const entry = getMostRecentCriticalEntry();
|
||||||
|
|
||||||
// in case there is no entry yet or at least one check failed in the most recent entry
|
// in case there is no entry yet or at least one check failed in the most recent entry
|
||||||
if (!entry || entry.checks.some(({ up }) => !up)) {
|
if (!entry || entry.checks.some(({ up }) => !up)) {
|
||||||
|
@ -46,7 +46,7 @@ function getAverageResponseTime() {
|
||||||
/**
|
/**
|
||||||
* Get one, most current critical entry
|
* Get one, most current critical entry
|
||||||
*/
|
*/
|
||||||
function getCurrentCriticalEntry() {
|
function getMostRecentCriticalEntry() {
|
||||||
return db.get("critical").orderBy("date", "desc").head().value();
|
return db.get("critical").orderBy("date", "desc").head().value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ module.exports = (req, res) => {
|
||||||
// failures, hence 0 timeout on those.
|
// failures, hence 0 timeout on those.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// include some health information in the response body
|
// include some health information in the response body
|
||||||
const entry = getCurrentCriticalEntry();
|
const entry = getMostRecentCriticalEntry();
|
||||||
const disabled = getDisabled();
|
const disabled = getDisabled();
|
||||||
|
|
||||||
res.status(statusCode).send({ disabled, entry });
|
res.status(statusCode).send({ disabled, entry });
|
||||||
|
|
Reference in New Issue