From: Chocobozzz Date: Mon, 1 Oct 2018 07:14:00 +0000 (+0200) Subject: Increase timeout on upload endpoint X-Git-Tag: v1.0.0-beta.16~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8b917537af2217ad0c87d49fd2ffa693d46a499c;p=oweals%2Fpeertube.git Increase timeout on upload endpoint --- 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