2
0
Эх сурвалжийг харах

add more interval to avoid sending too many requests to milvus (#146)

ryjiang 2 жил өмнө
parent
commit
866593e4f3

+ 13 - 11
client/src/pages/schema/Create.tsx

@@ -312,18 +312,20 @@ const CreateIndex = (props: {
       showCode={showCode}
       showCode={showCode}
       codeBlocksData={codeBlockData}
       codeBlocksData={codeBlockData}
     >
     >
-      <CreateForm
-        updateForm={updateStepTwoForm}
-        metricOptions={metricOptions}
-        indexOptions={indexOptions}
-        formValue={indexSetting}
-        checkIsValid={checkIsValid}
-        validation={validation}
-        indexParams={indexCreateParams}
-        indexTypeChange={onIndexTypeChange}
-      />
+      <>
+        <CreateForm
+          updateForm={updateStepTwoForm}
+          metricOptions={metricOptions}
+          indexOptions={indexOptions}
+          formValue={indexSetting}
+          checkIsValid={checkIsValid}
+          validation={validation}
+          indexParams={indexCreateParams}
+          indexTypeChange={onIndexTypeChange}
+        />
 
 
-      <SizingInfo info={sizingInfo} />
+        <SizingInfo info={sizingInfo} />
+      </>
     </DialogTemplate>
     </DialogTemplate>
   );
   );
 };
 };

+ 1 - 1
client/src/pages/schema/IndexTypeElement.tsx

@@ -116,7 +116,7 @@ const IndexTypeElement: FC<{
           ? fetchStatus()
           ? fetchStatus()
           : timer && clearTimeout(timer);
           : timer && clearTimeout(timer);
         setStatus(status);
         setStatus(status);
-      }, 500);
+      }, 3000);
     }
     }
   }, [collectionName, data, status]);
   }, [collectionName, data, status]);
 
 

+ 3 - 3
server/src/crons/crons.service.ts

@@ -54,7 +54,7 @@ export class CronsService {
         throw new Error(error);
         throw new Error(error);
       }
       }
     };
     };
-    this.schedulerRegistry.setCronJobEverySecond(name, task, address);
+    this.schedulerRegistry.setCronJobEveryFiveSecond(name, task, address);
   }
   }
 }
 }
 
 
@@ -68,9 +68,9 @@ export class SchedulerRegistry {
     return target?.entity;
     return target?.entity;
   }
   }
 
 
-  setCronJobEverySecond(name: string, func: () => {}, address: string) {
+  setCronJobEveryFiveSecond(name: string, func: () => {}, address: string) {
     // The cron job will run every second
     // The cron job will run every second
-    this.setCronJob(name, '* * * * * *', func, address);
+    this.setCronJob(name, '*/5 * * * * *', func, address);
   }
   }
 
 
   // ┌────────────── second (optional)
   // ┌────────────── second (optional)