diff --git a/main.go b/main.go index a33496f..6a8e7a3 100644 --- a/main.go +++ b/main.go @@ -17,6 +17,8 @@ func main() { s := server.New() grpcPool, err := backend.NewPool(backend.Options{ + InitCapacity: 2, + MaxCapacity: 4, Dial: func() (*grpc.ClientConn, error) { return grpc.Dial("192.168.1.101:50006", grpc.WithInsecure()) }, diff --git a/module/member/signin.go b/module/member/signin.go index 8ad33bf..69b93f3 100644 --- a/module/member/signin.go +++ b/module/member/signin.go @@ -12,12 +12,15 @@ import ( func SignIn(sctx *server.ServerContext, ctx *fasthttp.RequestCtx) { grpcPool := sctx.Value("grpc").(backend.Pool) + fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available()) c, err := grpcPool.Get() if nil != err { } defer c.Close() + fmt.Fprintf(ctx, "avail: %d\n", grpcPool.Available()) + signinId := string(ctx.FormValue("signinId")) signinPw := string(ctx.FormValue("signinPw"))