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:
@@ -73,12 +73,15 @@ function internalRequest<T>(
|
||||
params?: RequestInit
|
||||
) {
|
||||
const wrappedFetch = fetchRetry(fetch, {
|
||||
retries: 3,
|
||||
retries: 2,
|
||||
retryDelay: function (attempt) {
|
||||
return Math.pow(2, attempt) * 150 // 150, 300, 600
|
||||
},
|
||||
})
|
||||
return wrappedFetch(url, params)
|
||||
return wrappedFetch(url, {
|
||||
...params,
|
||||
signal: AbortSignal.timeout(15_000),
|
||||
})
|
||||
}),
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user