mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 18:25:56 +08:00
feat: do not retry query range API's with i/o timeout error (#4768)
* feat: do not retry query range API's with i/o timeout error * feat: do not retry query range API's with i/o timeout error
This commit is contained in:
parent
6eced60bf5
commit
43ceb052d8
@ -30,7 +30,8 @@ export function ErrorResponseHandler(error: AxiosError): ErrorResponse {
|
||||
statusCode,
|
||||
payload: null,
|
||||
error: errorMessage,
|
||||
message: null,
|
||||
message: (response.data as any)?.status,
|
||||
body: JSON.stringify((response.data as any).data),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -152,6 +152,16 @@ function GridCardGraph({
|
||||
widget?.panelTypes,
|
||||
widget.timePreferance,
|
||||
],
|
||||
retry(failureCount, error): boolean {
|
||||
if (
|
||||
String(error).includes('status: error') &&
|
||||
String(error).includes('i/o timeout')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return failureCount < 2;
|
||||
},
|
||||
keepPreviousData: true,
|
||||
enabled: queryEnabledCondition,
|
||||
refetchOnMount: false,
|
||||
|
@ -34,7 +34,7 @@ export async function GetMetricQueryRange(
|
||||
|
||||
if (response.statusCode >= 400) {
|
||||
throw new Error(
|
||||
`API responded with ${response.statusCode} - ${response.error}`,
|
||||
`API responded with ${response.statusCode} - ${response.error} status: ${response.message}, errors: ${response?.body}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,8 @@ export interface ErrorResponse {
|
||||
statusCode: ErrorStatusCode;
|
||||
payload: null;
|
||||
error: string;
|
||||
message: null;
|
||||
message: string | null;
|
||||
body?: string | null;
|
||||
}
|
||||
|
||||
export interface SuccessResponse<T, P = unknown> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user