Skip to content

Commit

Permalink
Remove DiscoveryTimeout config option.
Browse files Browse the repository at this point in the history
closes #88
  • Loading branch information
aalda committed Apr 9, 2019
1 parent feb5da1 commit 4d95a59
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
3 changes: 0 additions & 3 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type HTTPClient struct {
healthcheckEnabled bool
healthcheckTimeout time.Duration
discoveryEnabled bool
discoveryTimeout time.Duration

mu sync.RWMutex // guards the next block
running bool
Expand Down Expand Up @@ -91,7 +90,6 @@ func NewSimpleHTTPClient(httpClient *http.Client, urls []string) (*HTTPClient, e
healthcheckEnabled: false,
healthcheckTimeout: off,
discoveryEnabled: false,
discoveryTimeout: off,
readPreference: Primary,
maxRetries: 0,
retrier: NewNoRequestRetrier(httpClient),
Expand Down Expand Up @@ -125,7 +123,6 @@ func NewHTTPClient(options ...HTTPClientOptionF) (*HTTPClient, error) {
healthcheckEnabled: DefaultHealthCheckEnabled,
healthcheckTimeout: DefaultHealthCheckTimeout,
discoveryEnabled: DefaultTopologyDiscoveryEnabled,
discoveryTimeout: DefaultTopologyDiscoveryTimeout,
readPreference: Primary,
maxRetries: DefaultMaxRetries,
}
Expand Down
9 changes: 0 additions & 9 deletions client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ const (
// DefaultTopologyDiscoveryEnabled specifies if the discoverer is enabled by default.
DefaultTopologyDiscoveryEnabled = true

// DefaultTopologyDiscoveryTimeout specifies the time the discoverer waits for
// a response from QED.
DefaultTopologyDiscoveryTimeout = 2 * time.Second

// off is used to disable timeouts.
off = -1 * time.Second
)
Expand Down Expand Up @@ -123,10 +119,6 @@ type Config struct {
// topology when requests fail.
EnableTopologyDiscovery bool

// DiscoveryTimeout is the timeout in seconds the discoverer waits for a response
// from a QED server.
DiscoveryTimeout time.Duration

// EnableHealthChecks enables helthchecks of all endpoints in the current cluster topology.
EnableHealthChecks bool

Expand All @@ -152,7 +144,6 @@ func DefaultConfig() *Config {
MaxRetries: DefaultMaxRetries,
EnableTopologyDiscovery: DefaultTopologyDiscoveryEnabled,
EnableHealthChecks: DefaultHealthCheckEnabled,
DiscoveryTimeout: DefaultTopologyDiscoveryTimeout,
HealthCheckTimeout: DefaultHealthCheckTimeout,
AttemptToReviveEndpoints: false,
}
Expand Down
8 changes: 0 additions & 8 deletions client/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ func configToOptions(conf *Config) ([]HTTPClientOptionF, error) {
SetReadPreference(conf.ReadPreference),
SetMaxRetries(conf.MaxRetries),
SetTopologyDiscovery(conf.EnableTopologyDiscovery),
SetDiscoveryTimeout(conf.DiscoveryTimeout),
SetHealthchecks(conf.EnableHealthChecks),
SetHealthCheckTimeout(conf.HealthCheckTimeout),
SetAttemptToReviveEndpoints(conf.AttemptToReviveEndpoints),
Expand Down Expand Up @@ -126,13 +125,6 @@ func SetTopologyDiscovery(enable bool) HTTPClientOptionF {
}
}

func SetDiscoveryTimeout(seconds time.Duration) HTTPClientOptionF {
return func(c *HTTPClient) error {
c.discoveryTimeout = seconds
return nil
}
}

func SetHealthchecks(enable bool) HTTPClientOptionF {
return func(c *HTTPClient) error {
c.healthcheckEnabled = enable
Expand Down

0 comments on commit 4d95a59

Please sign in to comment.