diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-01-23 18:31:58 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-01-23 18:31:58 +0100 |
commit | 45239549bf2659998dcf9196d86974b0b625912e (patch) | |
tree | 823d324db097400a7b5ae59a03deff54c5fd86ef /src/utils.js | |
parent | 2cc8ebf134b66047cd639ee7324e1ecfd5c5fd18 (diff) | |
download | PeerTube-45239549bf2659998dcf9196d86974b0b625912e.tar.gz PeerTube-45239549bf2659998dcf9196d86974b0b625912e.tar.zst PeerTube-45239549bf2659998dcf9196d86974b0b625912e.zip |
Finalise the join in a network and add the ability to quit it
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/utils.js b/src/utils.js index 5880c6c90..176648a31 100644 --- a/src/utils.js +++ b/src/utils.js | |||
@@ -56,7 +56,7 @@ | |||
56 | utils.makeMultipleRetryRequest = function (all_data, pods, callbackEach, callback) { | 56 | utils.makeMultipleRetryRequest = function (all_data, pods, callbackEach, callback) { |
57 | if (!callback) { | 57 | if (!callback) { |
58 | callback = callbackEach | 58 | callback = callbackEach |
59 | callbackEach = function () {} | 59 | callbackEach = null |
60 | } | 60 | } |
61 | 61 | ||
62 | var url = http + '://' + host + ':' + port | 62 | var url = http + '://' + host + ':' + port |
@@ -71,9 +71,13 @@ | |||
71 | // Make a request for each pod | 71 | // Make a request for each pod |
72 | async.each(pods, function (pod, callback_each_async) { | 72 | async.each(pods, function (pod, callback_each_async) { |
73 | function callbackEachRetryRequest (err, response, body, url, pod) { | 73 | function callbackEachRetryRequest (err, response, body, url, pod) { |
74 | callbackEach(err, response, body, url, pod, function () { | 74 | if (callbackEach !== null) { |
75 | callbackEach(err, response, body, url, pod, function () { | ||
76 | callback_each_async() | ||
77 | }) | ||
78 | } else { | ||
75 | callback_each_async() | 79 | callback_each_async() |
76 | }) | 80 | } |
77 | } | 81 | } |
78 | 82 | ||
79 | var params = { | 83 | var params = { |