Merged in feat/sw-3006-timeout-fetch (pull request #2335)
feat(SW-3006): added default timeout to all requests * feat(sw-3006): added default timeout to all requests * Fixed spreading Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -15,6 +15,7 @@ export default async (request: Request, _context: Context) => {
|
||||
)
|
||||
const response = await fetch(url, {
|
||||
headers,
|
||||
signal: AbortSignal.timeout(30_000),
|
||||
})
|
||||
if (!response.ok) {
|
||||
const text = await response.text()
|
||||
|
||||
@@ -18,6 +18,7 @@ export default async (request: Request, _context: Context) => {
|
||||
)
|
||||
const response = await fetch(url, {
|
||||
headers,
|
||||
signal: AbortSignal.timeout(30_000),
|
||||
})
|
||||
if (!response.ok) {
|
||||
const text = await response.text()
|
||||
|
||||
@@ -122,6 +122,7 @@ async function callWarmup(key: WarmupFunctionsKey, context: Context) {
|
||||
cache: "no-store",
|
||||
Authorization: `Bearer ${warmupToken}`,
|
||||
},
|
||||
signal: AbortSignal.timeout(30_000),
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
@@ -11,6 +11,7 @@ export async function warmupHotelDataOnLang(lang: Lang) {
|
||||
`${PUBLIC_URL}/api/hoteldata?lang=${lang}`,
|
||||
{
|
||||
headers: { cache: "no-store" },
|
||||
signal: AbortSignal.timeout(30_000),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user