Remove useless use of async.each

This commit is contained in:
Chocobozzz 2016-06-14 20:14:17 +02:00
parent bf4c77f0f4
commit 3c8ee69f88
1 changed files with 14 additions and 16 deletions

View File

@ -152,7 +152,7 @@ function makeRequests () {
} }
// For each requests to make, we add it to the correct request type // For each requests to make, we add it to the correct request type
async.each(requests, function (poolRequest, callbackEach) { requests.forEach(function (poolRequest) {
if (REQUEST_SCHEDULER_TYPE.indexOf(poolRequest.type) > -1) { if (REQUEST_SCHEDULER_TYPE.indexOf(poolRequest.type) > -1) {
const requestTypeToMake = requestsToMake[poolRequest.type] const requestTypeToMake = requestsToMake[poolRequest.type]
requestTypeToMake.requests.push(poolRequest.request) requestTypeToMake.requests.push(poolRequest.request)
@ -161,9 +161,8 @@ function makeRequests () {
logger.error('Unkown request type.', { request_type: poolRequest.type }) logger.error('Unkown request type.', { request_type: poolRequest.type })
return // abort return // abort
} }
})
callbackEach()
}, function () {
for (let type of Object.keys(requestsToMake)) { for (let type of Object.keys(requestsToMake)) {
const requestTypeToMake = requestsToMake[type] const requestTypeToMake = requestsToMake[type]
// If there are requests for this type // If there are requests for this type
@ -177,7 +176,6 @@ function makeRequests () {
} }
} }
}) })
})
} }
// Remove pods with a score of 0 (too many requests where they were unreachable) // Remove pods with a score of 0 (too many requests where they were unreachable)