Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Increase timeout on upload endpoint

Chocobozzz8b917537af22
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 581046782e..15ef8d4580 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