load fast
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-06-06 09:08:38 +03:30
parent ace6a0b288
commit e68543f869
12 changed files with 255 additions and 248 deletions
+13
View File
@@ -0,0 +1,13 @@
const DEFAULT_TIMEOUT_MS = 5000;
export async function fetchWithTimeout(
url: string,
options: RequestInit & { timeoutMs?: number } = {},
): Promise<Response> {
const { timeoutMs = DEFAULT_TIMEOUT_MS, ...fetchOptions } = options;
return fetch(url, {
...fetchOptions,
signal: AbortSignal.timeout(timeoutMs),
});
}