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 parent
406ed16ce4
commit
67dad45214
9 files changed
+34
-7
No files matched your search
@@ -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