RetryInterval should be a time.Duration

This commit is contained in:
Chelsea Holland Komlo
2018-05-25 17:12:13 -04:00
committed by Alex Dadgar
parent 02a64d0760
commit fa1d2de5df
6 changed files with 32 additions and 90 deletions

View File

@@ -267,6 +267,14 @@ func (c *Command) readConfig() *Config {
}
}
// COMPAT: Remove in 0.10. 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.")
@@ -560,7 +568,7 @@ func (c *Command) Run(args []string) int {
RetryJoin: config.Server.RetryJoin,
StartJoin: config.Server.StartJoin,
RetryMaxAttempts: config.Server.RetryMaxAttempts,
RetryInterval: config.Server.RetryInterval,
RetryInterval: config.Server.retryInterval,
}
go joiner.RetryJoin(serverJoinInfo)
}