mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
Fix retry interval not applying sleep duration
This commit is contained in:
@@ -107,15 +107,6 @@ func (c *Command) readConfig() *Config {
|
||||
return nil
|
||||
}
|
||||
|
||||
if cmdConfig.Server.RetryInterval != "" {
|
||||
dur, err := time.ParseDuration(cmdConfig.Server.RetryInterval)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error parsing retry interval: %s", err))
|
||||
return nil
|
||||
}
|
||||
cmdConfig.Server.retryInterval = dur
|
||||
}
|
||||
|
||||
// Split the servers.
|
||||
if servers != "" {
|
||||
cmdConfig.Client.Servers = strings.Split(servers, ",")
|
||||
@@ -188,6 +179,14 @@ func (c *Command) readConfig() *Config {
|
||||
return config
|
||||
}
|
||||
|
||||
// Parse the RetryInterval.
|
||||
dur, err := time.ParseDuration(config.Server.RetryInterval)
|
||||
if err != nil {
|
||||
c.Ui.Error(fmt.Sprintf("Error parsing retry interval: %s", err))
|
||||
return nil
|
||||
}
|
||||
config.Server.retryInterval = dur
|
||||
|
||||
// Check that the server is running in at least one mode.
|
||||
if !(config.Server.Enabled || config.Client.Enabled) {
|
||||
c.Ui.Error("Must specify either server, client or dev mode for the agent.")
|
||||
|
||||
Reference in New Issue
Block a user