diff options
| author | chenwanli <chenwanli@sensetime.com> | 2019-01-10 19:42:31 +0800 |
|---|---|---|
| committer | chenwanli <chenwanli@sensetime.com> | 2019-01-10 20:21:08 +0800 |
| commit | 39c745588111cebef0475f2453ee0715e0153c49 (patch) | |
| tree | 3d000a41408651ef4d2b6331501c550387c4a5a7 /weed/operation | |
| parent | 0a3e83a36a067a282a3cecec06d7bb577f1822ba (diff) | |
| download | seaweedfs-39c745588111cebef0475f2453ee0715e0153c49.tar.xz seaweedfs-39c745588111cebef0475f2453ee0715e0153c49.zip | |
Set http timeout to 5s
Diffstat (limited to 'weed/operation')
| -rw-r--r-- | weed/operation/upload_content.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/weed/operation/upload_content.go b/weed/operation/upload_content.go index 030bf5889..8cf31e382 100644 --- a/weed/operation/upload_content.go +++ b/weed/operation/upload_content.go @@ -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("\\", "\\\\", "\"", "\\\"") |
