fix: fetch timeout for external requests to small (#881)
* fix: fetch timeout for external requests to small * fix: format issue * fix: move clear timeout for fetch to finally
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { extractErrorMessage } from "@homarr/common";
|
||||
import { extractErrorMessage, fetchWithTimeout } from "@homarr/common";
|
||||
import { logger } from "@homarr/log";
|
||||
|
||||
export const sendPingRequestAsync = async (url: string) => {
|
||||
try {
|
||||
return await fetch(url).then((response) => ({ statusCode: response.status }));
|
||||
return await fetchWithTimeout(url).then((response) => ({ statusCode: response.status }));
|
||||
} catch (error) {
|
||||
logger.error("packages/ping/src/index.ts:", error);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user