From 1e4b0080ff1b4e802f71ec1f4cbf8cbcc70cdcbd Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Jan 2017 21:17:07 +0100 Subject: Server: requests refractoring --- server/lib/friends.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/lib/friends.js') 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) { else podsScore[foreignPodHost] = 1 }) - callback() + return callback() }) } @@ -212,6 +212,7 @@ function computeWinningPods (hosts, podsScore) { // Only add a pod if it exists in more than a half base pods const podsList = [] const baseScore = hosts.length / 2 + Object.keys(podsScore).forEach(function (podHost) { // If the pod is not me and with a good score we add it if (isMe(podHost) === false && podsScore[podHost] > baseScore) { -- cgit v1.2.3