Apply suggestions from code review
Co-authored-by: Ivaylo Novakov <ro-tex@users.noreply.github.com>
This commit is contained in:
parent
c08d53f6e0
commit
ec4655f581
|
@ -15,7 +15,7 @@ function getStatusCode() {
|
||||||
return StatusCodes.SERVICE_UNAVAILABLE;
|
return StatusCodes.SERVICE_UNAVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// grab one most recent critical entry element from DB
|
// grab the most recent critical entry element from DB
|
||||||
const entry = getCurrentCriticalEntry();
|
const entry = getCurrentCriticalEntry();
|
||||||
|
|
||||||
// find out whether every check in the entry is up
|
// find out whether every check in the entry is up
|
||||||
|
@ -63,7 +63,7 @@ module.exports = (req, res) => {
|
||||||
const timeout = statusCode === StatusCodes.OK ? getAvarageResponseTime() : 0;
|
const timeout = statusCode === StatusCodes.OK ? getAvarageResponseTime() : 0;
|
||||||
|
|
||||||
// We want to delay the response for the load balancer to be able to prioritize
|
// We want to delay the response for the load balancer to be able to prioritize
|
||||||
// servers based on the successful response time of thid endpoint. Load balancer
|
// servers based on the successful response time of this endpoint. Load balancer
|
||||||
// will pull the server if the response is an error so there is no point in delaying
|
// will pull the server if the response is an error so there is no point in delaying
|
||||||
// failures, hence 0 timeout on those.
|
// failures, hence 0 timeout on those.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
@ -25,4 +25,4 @@ const verboseJob = schedule.scheduleJob("0 * * * *", async () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
criticalJob.invoke();
|
criticalJob.invoke();
|
||||||
verboseJob.invoke();
|
verboseJob.invoke();
|
||||||
}, 60 * 0); // delay for 60s to give other services time to start up
|
}, 60 * 1000); // delay for 60s to give other services time to start up
|
||||||
|
|
Reference in New Issue