liuxiaolong
2021-02-03 cb12947ffbd30cea09bbe253f0e28b0e2222f952
micronode.go
@@ -23,7 +23,7 @@
}
func NewMicroNode(ctx context.Context,q chan os.Signal, serverId string, reg *RegisterInfo, fnLog func(v ...interface{})) (*MicroNode, error){
   conf := NewConfig(KEY_REGISTER,512,5,1000,100,1000, fnLog)
   conf := NewConfig(KEY_REGISTER,512,5,1000,1000,1000, fnLog)
   handle, err := Register(ctx, q, conf, reg)
   if err != nil {
      return nil, err
@@ -106,6 +106,8 @@
            //收到其它进程的请求消息
            go ms.serve(msgR, keyR)
         }
         time.Sleep(50 * time.Millisecond)
      }
   }
}
@@ -201,14 +203,14 @@
         Msg: err.Error(),
      }
   } else {
      ms.printLog("reqBody:", reqBody, "to key: ", p)
      ms.printLog("srcProc:", msgR.SrcProc,"reqBody Path:", reqBody.Path, " contentType:", reqBody.ContentType, " formMap:",reqBody.FormMap, " postFormMap:", reqBody.PostFormMap, "to key: ", p)
      if f,ok := ms.handlers[reqBody.Path];ok {
         reqBody.SrcProc = msgR.SrcProc
         ri = f(&reqBody)
         ms.printLog("call funcMap f,reply:", *ri)
      } else {
         ms.printLog("ms.funcMap not eixst path")
         ms.printLog("ms.funcMap not eixst path: ", reqBody.Path)
         ri = &Reply{
            Success: false,
            Msg: "请求的接口不存在,请检查url",