Skip to content

Commit

Permalink
stop rpc server when main function exit (#120)
Browse files Browse the repository at this point in the history
add defer s.Stop() to mainTemplate, in order to stop rpc server when main function exit
  • Loading branch information
supermario1990 authored Oct 12, 2020
1 parent da1a93e commit 84cc41d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/goctl/rpc/gen/genmain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 84cc41d

Please sign in to comment.