mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
close resp body, close snapshot
This commit is contained in:
parent
ab285a90bb
commit
6edce10980
2
etcd.go
2
etcd.go
@ -212,7 +212,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// open the snapshot
|
// open the snapshot
|
||||||
go server.Snapshot()
|
//go server.Snapshot()
|
||||||
|
|
||||||
if webPort != -1 {
|
if webPort != -1 {
|
||||||
// start web
|
// start web
|
||||||
|
3
util.go
3
util.go
@ -68,9 +68,8 @@ func Get(t *transHandler, path string) (*http.Response, error) {
|
|||||||
func leaderClient() string {
|
func leaderClient() string {
|
||||||
resp, _ := Get(&serverTransHandler, server.Leader()+"/client")
|
resp, _ := Get(&serverTransHandler, server.Leader()+"/client")
|
||||||
if resp != nil {
|
if resp != nil {
|
||||||
defer resp.Body.Close()
|
|
||||||
body, _ := ioutil.ReadAll(resp.Body)
|
body, _ := ioutil.ReadAll(resp.Body)
|
||||||
|
resp.Body.Close()
|
||||||
return string(body)
|
return string(body)
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user