Skip to content

Commit 2657593

Browse files
committed
close connection once request is done
1 parent bc5ea9e commit 2657593

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

http/handlers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,11 @@ func (s *Server) RPCCallHandler(newClient func() Client) http.HandlerFunc {
7373
returnError(w, errors.Cause(err).(perrors.Error))
7474
return
7575
}
76+
// TODO: Re-Use connections instead of creating a new connection for each request.
7677
client := newClient()
7778
client.Connect(ctx, u)
79+
defer client.CloseConn()
80+
7881
md := make(metadata.Metadata)
7982

8083
inputMessage, err := ioutil.ReadAll(r.Body)

0 commit comments

Comments
 (0)