Skip to content

Commit

Permalink
add SetMaxConns sets the maxIdleConns, maxIdleConnsPerHost.
Browse files Browse the repository at this point in the history
  • Loading branch information
king41409 committed Apr 12, 2019
1 parent 47cce83 commit 3e4c193
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions oss/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,3 +803,11 @@ func (client Client) do(method, bucketName string, params map[string]interface{}
return client.Conn.Do(method, bucketName, "", params,
headers, data, 0, nil)
}

// SetMaxConns sets the maxIdleConns, maxIdleConnsPerHost.
func SetMaxConns(maxIdleConns, maxIdleConnsPerHost int) ClientOption {
return func(client *Client) {
client.Config.HTTPMaxConns.MaxIdleConns = maxIdleConns
client.Config.HTTPMaxConns.MaxIdleConnsPerHost = maxIdleConnsPerHost
}
}

0 comments on commit 3e4c193

Please sign in to comment.