diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 10:43:54 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 10:43:54 +0200 |
commit | bda65bdc9f3ce7d4b6e97cb9afaca25b71added3 (patch) | |
tree | 812d3035b3aa97862a050e92301840e4f2545ae2 /server | |
parent | 10db166bbe510af27cb20cc0f028537af0df9c41 (diff) | |
download | PeerTube-bda65bdc9f3ce7d4b6e97cb9afaca25b71added3.tar.gz PeerTube-bda65bdc9f3ce7d4b6e97cb9afaca25b71added3.tar.zst PeerTube-bda65bdc9f3ce7d4b6e97cb9afaca25b71added3.zip |
Fix pod removal when it is down
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/api/pods.ts | 2 | ||||
-rw-r--r-- | server/lib/friends.ts | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/server/controllers/api/pods.ts b/server/controllers/api/pods.ts index ec94efc35..804aa0659 100644 --- a/server/controllers/api/pods.ts +++ b/server/controllers/api/pods.ts | |||
@@ -83,6 +83,6 @@ function removeFriendController (req: express.Request, res: express.Response, ne | |||
83 | const pod = res.locals.pod as PodInstance | 83 | const pod = res.locals.pod as PodInstance |
84 | 84 | ||
85 | removeFriend(pod) | 85 | removeFriend(pod) |
86 | .then(() => (res.type('json').status(204).end())) | 86 | .then(() => res.type('json').status(204).end()) |
87 | .catch(err => next(err)) | 87 | .catch(err => next(err)) |
88 | } | 88 | } |
diff --git a/server/lib/friends.ts b/server/lib/friends.ts index 4cc4a82bf..65349ef5f 100644 --- a/server/lib/friends.ts +++ b/server/lib/friends.ts | |||
@@ -251,13 +251,10 @@ function removeFriend (pod: PodInstance) { | |||
251 | } | 251 | } |
252 | 252 | ||
253 | return makeSecureRequest(requestParams) | 253 | return makeSecureRequest(requestParams) |
254 | .catch(err => logger.warn('Cannot notify friends %s we are quitting him.', pod.host, err)) | ||
254 | .then(() => pod.destroy()) | 255 | .then(() => pod.destroy()) |
255 | .then(() => { | 256 | .then(() => logger.info('Removed friend %s.', pod.host)) |
256 | logger.info('Removed friend.') | 257 | .catch(err => logger.error('Cannot destroy friend %s.', pod.host, err)) |
257 | }) | ||
258 | .catch(err => { | ||
259 | logger.error('Some errors while quitting friend %s (id: %d).', pod.host, pod.id, err) | ||
260 | }) | ||
261 | } | 258 | } |
262 | 259 | ||
263 | function getRequestScheduler () { | 260 | function getRequestScheduler () { |