aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-26 10:40:37 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-26 10:40:37 +0200
commit51c443dbe0284c5ec54033be06f554ec37397bce (patch)
tree5312f85f1c8b9c62a77c05c8e440e301e5be3137 /server/lib
parentfaab3a8453e2af92f95518e55e00293ac140b6e8 (diff)
downloadPeerTube-51c443dbe0284c5ec54033be06f554ec37397bce.tar.gz
PeerTube-51c443dbe0284c5ec54033be06f554ec37397bce.tar.zst
PeerTube-51c443dbe0284c5ec54033be06f554ec37397bce.zip
Be tolerant with remote requests
Just remove videos we don't want
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/request/abstract-request-scheduler.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/lib/request/abstract-request-scheduler.ts b/server/lib/request/abstract-request-scheduler.ts
index 08e371a02..f838c47f2 100644
--- a/server/lib/request/abstract-request-scheduler.ts
+++ b/server/lib/request/abstract-request-scheduler.ts
@@ -88,8 +88,10 @@ abstract class AbstractRequestScheduler <T> {
88 // The function fire some useful callbacks 88 // The function fire some useful callbacks
89 try { 89 try {
90 const { response } = await makeSecureRequest(params) 90 const { response } = await makeSecureRequest(params)
91 if (response.statusCode !== 200 && response.statusCode !== 201 && response.statusCode !== 204) { 91
92 throw new Error('Status code not 20x : ' + response.statusCode) 92 // 400 because if the other pod is not up to date, it may not understand our request
93 if ([ 200, 201, 204, 400 ].indexOf(response.statusCode) === -1) {
94 throw new Error('Status code not 20x or 400 : ' + response.statusCode)
93 } 95 }
94 } catch (err) { 96 } catch (err) {
95 logger.error('Error sending secure request to %s pod.', toPod.host, err) 97 logger.error('Error sending secure request to %s pod.', toPod.host, err)