mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-29 17:52:32 +00:00
agent: add disable_idle_connections configurable (#15986)
* agent: add disable_keep_alives configurable * Add empty test * Add website doc * Change to disable_idle_connections * Update tests and doc * Add note about env * Changelog * Change to slice * Remove unused disable keep alive methods * Add invalid value test
This commit is contained in:
@@ -720,6 +720,24 @@ func (c *Client) SetMaxRetries(retries int) {
|
||||
c.config.MaxRetries = retries
|
||||
}
|
||||
|
||||
func (c *Client) SetMaxIdleConnections(idle int) {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
c.config.modifyLock.Lock()
|
||||
defer c.config.modifyLock.Unlock()
|
||||
|
||||
c.config.HttpClient.Transport.(*http.Transport).MaxIdleConns = idle
|
||||
}
|
||||
|
||||
func (c *Client) MaxIdleConnections() int {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
c.config.modifyLock.Lock()
|
||||
defer c.config.modifyLock.Unlock()
|
||||
|
||||
return c.config.HttpClient.Transport.(*http.Transport).MaxIdleConns
|
||||
}
|
||||
|
||||
func (c *Client) MaxRetries() int {
|
||||
c.modifyLock.RLock()
|
||||
defer c.modifyLock.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user