Skip to content

Commit

Permalink
Set max retries to 1 in agent's client
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Apr 12, 2019
1 parent 96994f1 commit 39c3f12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions cmd/agent_auditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ type auditorConfig struct {
}

func newAuditorConfig() *auditorConfig {
conf := client.DefaultConfig()
conf.AttemptToReviveEndpoints = true
conf.ReadPreference = client.Any
conf.MaxRetries = 1
return &auditorConfig{
Qed: client.DefaultConfig(),
Qed: conf,
Notifier: gossip.DefaultSimpleNotifierConfig(),
Store: gossip.DefaultRestSnapshotStoreConfig(),
Tasks: gossip.DefaultSimpleTasksManagerConfig(),
Expand All @@ -111,8 +115,6 @@ func runAgentAuditor(cmd *cobra.Command, args []string) error {
log.SetLogger("auditor", agentConfig.Log)

notifier := gossip.NewSimpleNotifierFromConfig(conf.Notifier)
conf.Qed.AttemptToReviveEndpoints = true
conf.Qed.ReadPreference = client.Any
qed, err := client.NewHTTPClientFromConfig(conf.Qed)
if err != nil {
return err
Expand Down
8 changes: 5 additions & 3 deletions cmd/agent_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ type monitorConfig struct {
}

func newMonitorConfig() *monitorConfig {
conf := client.DefaultConfig()
conf.AttemptToReviveEndpoints = true
conf.ReadPreference = client.Any
conf.MaxRetries = 1
return &monitorConfig{
Qed: client.DefaultConfig(),
Qed: conf,
Notifier: gossip.DefaultSimpleNotifierConfig(),
Store: gossip.DefaultRestSnapshotStoreConfig(),
Tasks: gossip.DefaultSimpleTasksManagerConfig(),
Expand All @@ -115,8 +119,6 @@ func runAgentMonitor(cmd *cobra.Command, args []string) error {
log.SetLogger("monitor", agentConfig.Log)

notifier := gossip.NewSimpleNotifierFromConfig(conf.Notifier)
conf.Qed.AttemptToReviveEndpoints = true
conf.Qed.ReadPreference = client.Any
qed, err := client.NewHTTPClientFromConfig(conf.Qed)
if err != nil {
return err
Expand Down

0 comments on commit 39c3f12

Please sign in to comment.