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

@@ -22,9 +22,6 @@ type Options struct {
Registry registry.Registry
Transport transport.Transport
// Register loop interval
RegisterInterval time.Duration
// Before and After funcs
BeforeStart []func() error
BeforeStop []func() error
@@ -168,7 +165,7 @@ func RegisterTTL(t time.Duration) Option {
// RegisterInterval specifies the interval on which to re-register
func RegisterInterval(t time.Duration) Option {
return func(o *Options) {
o.RegisterInterval = t
o.Server.Init(server.RegisterInterval(t))
}
}