diff options
| author | Chris Lu <chrislusf@users.noreply.github.com> | 2019-01-10 09:02:13 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-10 09:02:13 -0800 |
| commit | e978f3aaaba844f9b8def8fa9aed7872595f3245 (patch) | |
| tree | 3d000a41408651ef4d2b6331501c550387c4a5a7 /weed/util | |
| parent | 2a75a36b275ea7f47a95ad2efc70be22d5ed3fe2 (diff) | |
| parent | 39c745588111cebef0475f2453ee0715e0153c49 (diff) | |
| download | seaweedfs-e978f3aaaba844f9b8def8fa9aed7872595f3245.tar.xz seaweedfs-e978f3aaaba844f9b8def8fa9aed7872595f3245.zip | |
Merge pull request #829 from PapaYofen/fix-823
Fix https://github.com/chrislusf/seaweedfs/issues/823
Diffstat (limited to 'weed/util')
| -rw-r--r-- | weed/util/http_util.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/weed/util/http_util.go b/weed/util/http_util.go index 77a7a5fa3..21e0a678d 100644 --- a/weed/util/http_util.go +++ b/weed/util/http_util.go @@ -11,6 +11,7 @@ import ( "net/http" "net/url" "strings" + "time" "github.com/chrislusf/seaweedfs/weed/security" ) @@ -24,7 +25,10 @@ func init() { Transport = &http.Transport{ MaxIdleConnsPerHost: 1024, } - client = &http.Client{Transport: Transport} + client = &http.Client{ + Transport: Transport, + Timeout: 5 * time.Second, + } } func PostBytes(url string, body []byte) ([]byte, error) { @@ -63,6 +67,8 @@ func Post(url string, values url.Values) ([]byte, error) { return b, nil } +// github.com/chrislusf/seaweedfs/unmaintained/repeated_vacuum/repeated_vacuum.go +// may need increasing http.Client.Timeout func Get(url string) ([]byte, error) { r, err := client.Get(url) if err != nil { |
