fix: do not call models watch after first loading

This commit is contained in:
jialin
2025-03-14 16:43:36 +08:00
parent b47b99bd28
commit ccbc36f991
+6 -2
View File
@@ -277,6 +277,7 @@ const Models: React.FC = () => {
);
useEffect(() => {
let timer: any = null;
// fetch data first time
const getTableData = async (loadingVal?: boolean) => {
axiosToken?.cancel?.();
@@ -364,12 +365,15 @@ const Models: React.FC = () => {
setWorkerList(workerRes.items || []);
setCatalogList(cList);
setTimeout(() => {
clearTimeout(timer);
timer = setTimeout(() => {
createModelsInstanceChunkRequest();
}, 500);
createModelsChunkRequest();
}, 1000);
};
init();
return () => {
clearTimeout(timer);
axiosToken?.cancel?.();
chunkRequedtRef.current?.current?.cancel?.();
cacheDataListRef.current = [];