]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Increase timeout on upload endpoint
authorChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 07:14:00 +0000 (09:14 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 07:14:00 +0000 (09:14 +0200)
server/controllers/api/videos/index.ts

index 581046782e775b68c3bfcd4218d04d1e10153cee..15ef8d4580daa81fb9460727b196c9913d49a12d 100644 (file)
@@ -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