refactor use transtiemout

This commit is contained in:
Xiang Li 2013-10-21 17:53:24 -07:00
parent a659dec00b
commit 91cad59ada

View File

@ -223,7 +223,7 @@ func (t *transporter) Get(urlStr string) (*http.Response, *http.Request, error)
// Cancel the on fly HTTP transaction when timeout happens.
func (t *transporter) CancelWhenTimeout(req *http.Request) {
go func() {
time.Sleep(ElectionTimeout)
time.Sleep(tranTimeout)
t.transport.CancelRequest(req)
}()
}