浏览代码

refactor use transtiemout

Xiang Li 12 年之前
父节点
当前提交
91cad59ada
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      server/transporter.go

+ 1 - 1
server/transporter.go

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