Merged in fix/limit-time-to-response-for-cache-calls (pull request #1990)
fix: add timeout for redis-api calls SW-2635 Approved-by: Michael Zetterberg
This commit is contained in:
@@ -16,15 +16,14 @@ export async function set<T>(key: string, value: T, ttl: CacheTime) {
|
||||
},
|
||||
body: JSON.stringify({ data: value, ttl: getCacheTimeInSeconds(ttl) }),
|
||||
cache: "no-cache",
|
||||
signal: AbortSignal.timeout(3_000),
|
||||
})
|
||||
)
|
||||
|
||||
if (!response || error || !response.ok) {
|
||||
Sentry.captureMessage("Unable to SET cachekey", {
|
||||
level: "error",
|
||||
if (!response || !response.ok || error) {
|
||||
Sentry.captureException(error ?? new Error("Unable to SET cachekey"), {
|
||||
extra: {
|
||||
cacheKey: key,
|
||||
errorMessage: error instanceof Error ? error.message : undefined,
|
||||
statusCode: response?.status,
|
||||
statusText: response?.statusText,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user