]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Server: wait pod removal when finishing a request
authorChocobozzz <florian.bigard@gmail.com>
Mon, 17 Oct 2016 19:38:14 +0000 (21:38 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Mon, 17 Oct 2016 19:38:14 +0000 (21:38 +0200)
server/models/request.js

index 2d1c5af15802804aa2743970a7e0f3cd0459ad84..1a99dd2ea620ae80298f91519d767da2932005e4 100644 (file)
@@ -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 () {