1
0
Эх сурвалжийг харах

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 4 жил өмнө
parent
commit
84cc41df42

+ 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()