aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/friends.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/friends.ts')
-rw-r--r--server/lib/friends.ts6
1 files changed, 2 insertions, 4 deletions
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[]) {
141 logger.info('Make friends!') 141 logger.info('Make friends!')
142 return getMyPublicCert() 142 return getMyPublicCert()
143 .then(cert => { 143 .then(cert => {
144 return Promise.mapSeries(hosts, host => { 144 return Promise.each(hosts, host => computeForeignPodsList(host, podsScore)).then(() => cert)
145 return computeForeignPodsList(host, podsScore)
146 }).then(() => cert)
147 }) 145 })
148 .then(cert => { 146 .then(cert => {
149 logger.debug('Pods scores computed.', { podsScore: podsScore }) 147 logger.debug('Pods scores computed.', { podsScore: podsScore })
@@ -169,7 +167,6 @@ function quitFriends () {
169 const requestParams = { 167 const requestParams = {
170 method: 'POST' as 'POST', 168 method: 'POST' as 'POST',
171 path: '/api/' + API_VERSION + '/remote/pods/remove', 169 path: '/api/' + API_VERSION + '/remote/pods/remove',
172 sign: true,
173 toPod: null 170 toPod: null
174 } 171 }
175 172
@@ -178,6 +175,7 @@ function quitFriends () {
178 // The other pod will exclude us automatically after a while 175 // The other pod will exclude us automatically after a while
179 return Promise.map(pods, pod => { 176 return Promise.map(pods, pod => {
180 requestParams.toPod = pod 177 requestParams.toPod = pod
178
181 return makeSecureRequest(requestParams) 179 return makeSecureRequest(requestParams)
182 }, { concurrency: REQUESTS_IN_PARALLEL }) 180 }, { concurrency: REQUESTS_IN_PARALLEL })
183 .then(() => pods) 181 .then(() => pods)