From 8b917537af2217ad0c87d49fd2ffa693d46a499c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 1 Oct 2018 09:14:00 +0200 Subject: Increase timeout on upload endpoint --- server/controllers/api/videos/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 581046782..15ef8d458 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -158,6 +158,13 @@ function listVideoPrivacies (req: express.Request, res: express.Response) { } async function addVideo (req: express.Request, res: express.Response) { + // Processing the video could be long + // Set timeout to 10 minutes + req.setTimeout(1000 * 60 * 10, () => { + logger.error('Upload video has timed out.') + return res.sendStatus(408) + }) + const videoPhysicalFile = req.files['videofile'][0] const videoInfo: VideoCreate = req.body -- cgit v1.2.3