mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 04:56:12 +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,
|
statusCode,
|
||||||
payload: null,
|
payload: null,
|
||||||
error: errorMessage,
|
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?.panelTypes,
|
||||||
widget.timePreferance,
|
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,
|
keepPreviousData: true,
|
||||||
enabled: queryEnabledCondition,
|
enabled: queryEnabledCondition,
|
||||||
refetchOnMount: false,
|
refetchOnMount: false,
|
||||||
|
@ -34,7 +34,7 @@ export async function GetMetricQueryRange(
|
|||||||
|
|
||||||
if (response.statusCode >= 400) {
|
if (response.statusCode >= 400) {
|
||||||
throw new Error(
|
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;
|
statusCode: ErrorStatusCode;
|
||||||
payload: null;
|
payload: null;
|
||||||
error: string;
|
error: string;
|
||||||
message: null;
|
message: string | null;
|
||||||
|
body?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SuccessResponse<T, P = unknown> {
|
export interface SuccessResponse<T, P = unknown> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user