stop rpc server when main function exit (#120)

add defer s.Stop() to mainTemplate, in order to stop rpc server when main function exit
master
super_mario 4 years ago committed by GitHub
parent da1a93e932
commit 84cc41df42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save