From 51c443dbe0284c5ec54033be06f554ec37397bce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 26 Oct 2017 10:40:37 +0200 Subject: Be tolerant with remote requests Just remove videos we don't want --- server/lib/request/abstract-request-scheduler.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/lib/request/abstract-request-scheduler.ts') 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 { // The function fire some useful callbacks try { const { response } = await makeSecureRequest(params) - if (response.statusCode !== 200 && response.statusCode !== 201 && response.statusCode !== 204) { - throw new Error('Status code not 20x : ' + response.statusCode) + + // 400 because if the other pod is not up to date, it may not understand our request + if ([ 200, 201, 204, 400 ].indexOf(response.statusCode) === -1) { + throw new Error('Status code not 20x or 400 : ' + response.statusCode) } } catch (err) { logger.error('Error sending secure request to %s pod.', toPod.host, err) -- cgit v1.2.3