From 58097b7c80d9ec8ac6f032059b67bea611ec8005 Mon Sep 17 00:00:00 2001 From: Hayk Martiros Date: Thu, 15 Dec 2022 08:59:50 -0800 Subject: [PATCH] Add a 15s timeout on requests --- pages/api/baseten.js | 1 + pages/api/server.js | 1 + 2 files changed, 2 insertions(+) diff --git a/pages/api/baseten.js b/pages/api/baseten.js index a8573e9..06112ee 100644 --- a/pages/api/baseten.js +++ b/pages/api/baseten.js @@ -9,6 +9,7 @@ export default async function handler(req, res) { method: "POST", headers: headers, body: req.body, + signal: AbortSignal.timeout(15000), }); const data = await response.json(); diff --git a/pages/api/server.js b/pages/api/server.js index 4ac8532..349da8a 100644 --- a/pages/api/server.js +++ b/pages/api/server.js @@ -8,6 +8,7 @@ export default async function handler(req, res) { method: "POST", headers: headers, body: req.body, + signal: AbortSignal.timeout(15000), }); const data = await response.json();