Browse Source

fix build

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 year ago
parent
commit
64758d3eac

+ 4 - 0
server/src/collections/collections.service.ts

@@ -25,6 +25,7 @@ import {
   CreateIndexReq,
   DescribeIndexReq,
   DropIndexReq,
+  DataType,
 } from '@zilliz/milvus2-sdk-node';
 import { Parser } from '@json2csv/plainjs';
 import {
@@ -142,6 +143,9 @@ export class CollectionsService {
             maxCapacity: -1,
             maxLength: -1,
             autoID: false,
+            fieldID: '',
+            state: '',
+            dataType: DataType.JSON,
           },
         ]
       : [];

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

@@ -3,10 +3,10 @@ import {
   FlushReq,
   GetMetricsResponse,
   ClientConfig,
+  CONNECT_STATUS,
 } from '@zilliz/milvus2-sdk-node';
 import { LRUCache } from 'lru-cache';
 import { DEFAULT_MILVUS_PORT, INDEX_TTL, SimpleQueue } from '../utils';
-import { connectivityState } from '@grpc/grpc-js';
 import { clientCache } from '../app';
 import { DescribeIndexRes, AuthReq, AuthObject } from '../types';
 
@@ -131,10 +131,10 @@ export class MilvusService {
     return res;
   }
 
-  closeConnection(clientId: string): connectivityState {
+  async closeConnection(clientId: string): Promise<CONNECT_STATUS> {
     const { milvusClient } = clientCache.get(clientId);
 
-    const res = milvusClient.closeConnection();
+    const res = await milvusClient.closeConnection();
     // clear cache on disconnect
     clientCache.delete(milvusClient.clientId);