Apply suggestions from code review

Co-authored-by: Ivaylo Novakov <ro-tex@users.noreply.github.com>
This commit is contained in:
Karol Wypchło 2020-09-10 13:49:26 +02:00 committed by GitHub
parent c08d53f6e0
commit ec4655f581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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(() => {

View File

@ -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