Skip to content

Commit 5fcd73f

Browse files
committed
Merge pull request #601 from hashicorp/b-retry-interval
Fix retry interval not applying sleep duration
2 parents 3dd339f + 6cf66ff commit 5fcd73f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

command/agent/command.go

+8-9
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,6 @@ func (c *Command) readConfig() *Config {
107107
return nil
108108
}
109109

110-
if cmdConfig.Server.RetryInterval != "" {
111-
dur, err := time.ParseDuration(cmdConfig.Server.RetryInterval)
112-
if err != nil {
113-
c.Ui.Error(fmt.Sprintf("Error parsing retry interval: %s", err))
114-
return nil
115-
}
116-
cmdConfig.Server.retryInterval = dur
117-
}
118-
119110
// Split the servers.
120111
if servers != "" {
121112
cmdConfig.Client.Servers = strings.Split(servers, ",")
@@ -188,6 +179,14 @@ func (c *Command) readConfig() *Config {
188179
return config
189180
}
190181

182+
// Parse the RetryInterval.
183+
dur, err := time.ParseDuration(config.Server.RetryInterval)
184+
if err != nil {
185+
c.Ui.Error(fmt.Sprintf("Error parsing retry interval: %s", err))
186+
return nil
187+
}
188+
config.Server.retryInterval = dur
189+
191190
// Check that the server is running in at least one mode.
192191
if !(config.Server.Enabled || config.Client.Enabled) {
193192
c.Ui.Error("Must specify either server, client or dev mode for the agent.")

0 commit comments

Comments
 (0)