- callbackEach()
- }, function () {
- for (let type of Object.keys(requestsToMake)) {
- const requestTypeToMake = requestsToMake[type]
- // If there are requests for this type
- if (requestTypeToMake.requests.length !== 0) {
- makeRequest(type, requestTypeToMake.requests, function (err) {
- if (err) logger.error('Errors when sent ' + type + ' requests.', { error: err })
-
- // We made the requests, so we can remove them from the scheduler
- Requests.removeRequests(requestTypeToMake.ids)
- })
- }
+ for (let type of Object.keys(requestsToMake)) {
+ const requestTypeToMake = requestsToMake[type]
+ // If there are requests for this type
+ if (requestTypeToMake.requests.length !== 0) {
+ makeRequest(type, requestTypeToMake.requests, function (err) {
+ if (err) logger.error('Errors when sent ' + type + ' requests.', { error: err })
+
+ // We made the requests, so we can remove them from the scheduler
+ Requests.removeRequests(requestTypeToMake.ids)
+ })