@@ -100,10 +100,10 @@ public Void createCollection(MilvusServiceGrpc.MilvusServiceBlockingStub blockin
100100 .collectionName (request .getCollectionName ())
101101 .build ();
102102 indexService .createIndex (blockingStub , createIndexReq );
103- //load collection
103+ //load collection, set async to true since no need to wait loading progress
104104 try {
105105 //TimeUnit.MILLISECONDS.sleep(1000);
106- loadCollection (blockingStub , LoadCollectionReq .builder ().collectionName (request .getCollectionName ()).build ());
106+ loadCollection (blockingStub , LoadCollectionReq .builder ().async ( true ). collectionName (request .getCollectionName ()).build ());
107107 } catch (Exception e ) {
108108 throw new MilvusClientException (ErrorCode .SERVER_ERROR , "Load collection failed: " + e );
109109 }
@@ -160,8 +160,8 @@ public Void createCollectionWithSchema(MilvusServiceGrpc.MilvusServiceBlockingSt
160160 .build ();
161161 indexService .createIndex (blockingStub , createIndexReq );
162162 }
163- //load collection
164- loadCollection (blockingStub , LoadCollectionReq .builder ().collectionName (request .getCollectionName ()).build ());
163+ //load collection, set async to true since no need to wait loading progress
164+ loadCollection (blockingStub , LoadCollectionReq .builder ().async ( true ). collectionName (request .getCollectionName ()).build ());
165165 }
166166
167167 return null ;
@@ -289,7 +289,7 @@ public Void loadCollection(MilvusServiceGrpc.MilvusServiceBlockingStub blockingS
289289 .build ();
290290 Status status = blockingStub .loadCollection (loadCollectionRequest );
291291 rpcUtils .handleResponse (title , status );
292- if (request .getAsync ()) {
292+ if (! request .getAsync ()) {
293293 WaitForLoadCollection (blockingStub , request .getCollectionName (), request .getTimeout ());
294294 }
295295
0 commit comments