Set http timeout to 5s

This commit is contained in:
chenwanli
2019-01-10 19:42:31 +08:00
parent 0a3e83a36a
commit 39c7455881
2 changed files with 12 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ import (
"net/textproto"
"path/filepath"
"strings"
"time"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security"
@@ -30,9 +31,10 @@ var (
)
func init() {
client = &http.Client{Transport: &http.Transport{
MaxIdleConnsPerHost: 1024,
}}
client = &http.Client{
Transport: &http.Transport{MaxIdleConnsPerHost: 1024},
Timeout: 5 * time.Second,
}
}
var fileNameEscaper = strings.NewReplacer("\\", "\\\\", "\"", "\\\"")