From c2ee5ce83a2dac9ed16f1ac3e16bd5eca67eabd1 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 17 Oct 2016 21:38:14 +0200 Subject: [PATCH] Server: wait pod removal when finishing a request --- server/models/request.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/models/request.js b/server/models/request.js index 2d1c5af15..1a99dd2ea 100644 --- a/server/models/request.js +++ b/server/models/request.js @@ -185,14 +185,14 @@ function makeRequests () { if (success === true) { logger.debug('Removing requests for %s pod.', toPodId, { requestsIds: requestToMake.ids }) - // Remove the pod id of these request ids - removePodOf.call(self, requestToMake.ids, toPodId) goodPods.push(toPodId) + + // Remove the pod id of these request ids + removePodOf.call(self, requestToMake.ids, toPodId, callbackEach) } else { badPods.push(toPodId) + callbackEach() } - - callbackEach() }) }) }, function () {