Skip to content

Commit cdaff6a

Browse files
committed
fix: improve retry logic for project table
1 parent 34f0137 commit cdaff6a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/features/ProjectTable/useProjectFileRows.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ const filePathFileToTableFile = (file: FilePathFile, breadcrumbs: string[]): Tab
2626
export const useProjectFileRows = (params: GetFilesParams) => {
2727
const breadcrumbs = useProjectBreadcrumbs();
2828

29-
const { data, error, isError, isLoading } = useGetFiles(params);
29+
const { data, error, isError, isLoading } = useGetFiles(params, {
30+
query: {
31+
retry: (failureCount, error) => {
32+
if (error.response?.status === 404) {
33+
return false;
34+
}
35+
return failureCount < 3;
36+
},
37+
},
38+
});
3039

3140
const dataFiles = data?.files;
3241
const paths = data?.paths;

0 commit comments

Comments
 (0)