bug fix
This commit is contained in:
parent
cdd1f00d01
commit
34c7fef3cc
2
main.go
2
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())
|
||||
},
|
||||
|
|
|
@ -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"))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user