Move RegisterInterval into the server

This commit is contained in:
Asim Aslam
2019-01-24 13:22:17 +00:00
parent 8090f9968d
commit 539b8c1a3b
6 changed files with 74 additions and 98 deletions

View File

@@ -404,6 +404,10 @@ func (c *cmd) Before(ctx *cli.Context) error {
serverOpts = append(serverOpts, server.RegisterTTL(ttl*time.Second))
}
if val := time.Duration(ctx.GlobalInt("register_interval")); val > 0 {
serverOpts = append(serverOpts, server.RegisterInterval(val*time.Second))
}
// client opts
if r := ctx.Int("client_retries"); r >= 0 {
clientOpts = append(clientOpts, client.Retries(r))