mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 08:50:56 +01:00
* fix: fetch timeout for external requests to small * fix: format issue * fix: move clear timeout for fetch to finally
14 lines
418 B
TypeScript
14 lines
418 B
TypeScript
import { extractErrorMessage, fetchWithTimeout } from "@homarr/common";
|
|
import { logger } from "@homarr/log";
|
|
|
|
export const sendPingRequestAsync = async (url: string) => {
|
|
try {
|
|
return await fetchWithTimeout(url).then((response) => ({ statusCode: response.status }));
|
|
} catch (error) {
|
|
logger.error("packages/ping/src/index.ts:", error);
|
|
return {
|
|
error: extractErrorMessage(error),
|
|
};
|
|
}
|
|
};
|