浏览代码

add debug logs

Signed-off-by: nameczz <zizhao.chen@zilliz.com>
nameczz 3 年之前
父节点
当前提交
e80d084539
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 3 1
      express/src/middlewares/index.ts
  2. 1 0
      express/src/milvus/milvus.service.ts

+ 3 - 1
express/src/middlewares/index.ts

@@ -14,11 +14,13 @@ export const ReqHeaderMiddleware = (
   // all ape requests need set milvus address in header.
   // server will set activeaddress in milvus service.
   const milvusAddress = (req.headers[MILVUS_ADDRESS] as string) || '';
-
+  console.log('------ Middleware req headers -------', req.headers);
+  console.log('------ Attu cache ----- ', insightCache);
   //  only api request has MILVUS_ADDRESS.
   //  When client run in express, we dont need static files like: xx.js run this logic.
   //  Otherwise will cause 401 error.
   if (milvusAddress && insightCache.has(milvusAddress)) {
+    console.log('----- Set active address ---- ');
     MilvusService.activeAddress = milvusAddress;
     // insight cache will update expire time when use insightCache.get
     MilvusService.activeMilvusClient = insightCache.get(

+ 1 - 0
express/src/milvus/milvus.service.ts

@@ -36,6 +36,7 @@ export class MilvusService {
   }
 
   checkMilvus() {
+    console.log('---- check Milvus ----', MilvusService.activeMilvusClient);
     if (!MilvusService.activeMilvusClient) {
       throw HttpErrors(
         HTTP_STATUS_CODE.UNAUTHORIZED,