fix: add 10s timeout to Loops fetches (#543)
This commit is contained in:
parent
95551a425a
commit
0abde80109
@ -35,6 +35,7 @@ export async function updateLoopsContact({
|
|||||||
Authorization: `Bearer ${apiKey}`,
|
Authorization: `Bearer ${apiKey}`,
|
||||||
},
|
},
|
||||||
body: JSON.stringify(payload),
|
body: JSON.stringify(payload),
|
||||||
|
signal: AbortSignal.timeout(10_000),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
@ -42,7 +43,7 @@ export async function updateLoopsContact({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const errorPayload = await response.json().catch(() => null);
|
const errorPayload = await response.json().catch(() => null);
|
||||||
console.error("Loops contact update error:", {
|
console.warn("Loops contact update error:", {
|
||||||
status: response.status,
|
status: response.status,
|
||||||
email: payload.email,
|
email: payload.email,
|
||||||
userId: payload.userId,
|
userId: payload.userId,
|
||||||
|
|||||||
@ -58,6 +58,7 @@ async function sendLoopsTransactionalEmail({
|
|||||||
addToAudience: false,
|
addToAudience: false,
|
||||||
dataVariables,
|
dataVariables,
|
||||||
}),
|
}),
|
||||||
|
signal: AbortSignal.timeout(10_000),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user