Explorar o código

stop rpc server when main function exit (#120)

add defer s.Stop() to mainTemplate, in order to stop rpc server when main function exit
super_mario %!s(int64=4) %!d(string=hai) anos
pai
achega
84cc41df42
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      tools/goctl/rpc/gen/genmain.go

+ 1 - 0
tools/goctl/rpc/gen/genmain.go

@@ -39,6 +39,7 @@ func main() {
 		{{.registers}}
 	})
 	logx.Must(err)
+	defer s.Stop()
 
 	fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
 	s.Start()