Skip to content

Commit

Permalink
fix: add FIXED status to audits
Browse files Browse the repository at this point in the history
  • Loading branch information
alinarublea committed Feb 6, 2025
1 parent c6e3110 commit 8e6b9b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/support/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,18 +299,18 @@ export const getScrapedDataForSiteId = async (site, context) => {
};
};

export const fetchWithTimeout = async (url, timeout = TIMEOUT, log = console, options = {}) => {
export const fetchWithTimeout = async (url, log = console, options = {}) => {
const controller = new AbortController();
const { signal } = controller;
const id = setTimeout(() => controller.abort(), timeout);
const id = setTimeout(() => controller.abort(), TIMEOUT);

try {
const response = await fetch(url, { signal, ...options });
clearTimeout(id);
return response;
} catch (error) {
if (error instanceof AbortError) {
log.warn(`Request to ${url} timed out after ${timeout}ms`);
log.warn(`Request to ${url} timed out after ${TIMEOUT}ms`);
return { ok: false, status: 408 };
}
} finally {
Expand Down

0 comments on commit 8e6b9b5

Please sign in to comment.