From 709756b8e183f67ef9bf8f7bc149af4736260350 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Jul 2017 16:57:28 +0200 Subject: Async signature and various fixes --- server/lib/friends.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'server/lib/friends.ts') diff --git a/server/lib/friends.ts b/server/lib/friends.ts index 498144318..c24839cb6 100644 --- a/server/lib/friends.ts +++ b/server/lib/friends.ts @@ -141,9 +141,7 @@ function makeFriends (hosts: string[]) { logger.info('Make friends!') return getMyPublicCert() .then(cert => { - return Promise.mapSeries(hosts, host => { - return computeForeignPodsList(host, podsScore) - }).then(() => cert) + return Promise.each(hosts, host => computeForeignPodsList(host, podsScore)).then(() => cert) }) .then(cert => { logger.debug('Pods scores computed.', { podsScore: podsScore }) @@ -169,7 +167,6 @@ function quitFriends () { const requestParams = { method: 'POST' as 'POST', path: '/api/' + API_VERSION + '/remote/pods/remove', - sign: true, toPod: null } @@ -178,6 +175,7 @@ function quitFriends () { // The other pod will exclude us automatically after a while return Promise.map(pods, pod => { requestParams.toPod = pod + return makeSecureRequest(requestParams) }, { concurrency: REQUESTS_IN_PARALLEL }) .then(() => pods) -- cgit v1.2.3