aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/friends.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-17 21:17:07 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-17 21:17:07 +0100
commit1e4b0080ff1b4e802f71ec1f4cbf8cbcc70cdcbd (patch)
treef9c8ed5404ce905af5b22847fca6100f31b7f9b5 /server/lib/friends.js
parentda691c46df2f3c542d4fffaaa99ef18b6ef71f53 (diff)
downloadPeerTube-1e4b0080ff1b4e802f71ec1f4cbf8cbcc70cdcbd.tar.gz
PeerTube-1e4b0080ff1b4e802f71ec1f4cbf8cbcc70cdcbd.tar.zst
PeerTube-1e4b0080ff1b4e802f71ec1f4cbf8cbcc70cdcbd.zip
Server: requests refractoring
Diffstat (limited to 'server/lib/friends.js')
-rw-r--r--server/lib/friends.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js
index f634aedbb..1e8037c37 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -203,7 +203,7 @@ function computeForeignPodsList (host, podsScore, callback) {
203 else podsScore[foreignPodHost] = 1 203 else podsScore[foreignPodHost] = 1
204 }) 204 })
205 205
206 callback() 206 return callback()
207 }) 207 })
208} 208}
209 209
@@ -212,6 +212,7 @@ function computeWinningPods (hosts, podsScore) {
212 // Only add a pod if it exists in more than a half base pods 212 // Only add a pod if it exists in more than a half base pods
213 const podsList = [] 213 const podsList = []
214 const baseScore = hosts.length / 2 214 const baseScore = hosts.length / 2
215
215 Object.keys(podsScore).forEach(function (podHost) { 216 Object.keys(podsScore).forEach(function (podHost) {
216 // If the pod is not me and with a good score we add it 217 // If the pod is not me and with a good score we add it
217 if (isMe(podHost) === false && podsScore[podHost] > baseScore) { 218 if (isMe(podHost) === false && podsScore[podHost] > baseScore) {