Skip to content
Snippets Groups Projects
Commit 85ab20b2 authored by Jake Taylor's avatar Jake Taylor
Browse files

flip lazy connection flag

parent d95fe890
No related branches found
No related tags found
2 merge requests!39Merge release into master,!27add configurable flag for lazy connections to hostParams.go
......@@ -112,7 +112,7 @@ func NewHost(id *id.ID, address string, cert []byte, params HostParams) (host *H
}
// Connect immediately if configured to do so
if !params.LazyConnection {
if params.DisableLazyConnection {
// No mutex required
err = host.connect()
}
......
......@@ -41,9 +41,9 @@ type HostParams struct {
// If set, metric handling will be enabled on this host
EnableMetrics bool
// If true, a connection will only be established when a comm is sent
// If false, a connection will only be established when a comm is sent
// else, a connection will be established immediately upon host creation
LazyConnection bool
DisableLazyConnection bool
// List of sending errors that are deemed unimportant
// Reception of these errors will not update the Metric state
......@@ -65,7 +65,7 @@ func GetDefaultHostParams() HostParams {
SendTimeout: 2 * time.Minute,
PingTimeout: 5 * time.Second,
EnableMetrics: false,
LazyConnection: true,
DisableLazyConnection: false,
ExcludeMetricErrors: make([]string, 0),
KaClientOpts: keepalive.ClientParameters{
// Send keepAlive every Time interval
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment