fix ticker

This commit is contained in:
Asim Aslam 2019-01-24 16:08:04 +00:00
parent a5015692e3
commit e22fa01935

View File

@ -494,13 +494,12 @@ func (s *rpcServer) Start() error {
}() }()
go func() { go func() {
t := new(time.Ticker)
// new ticker
t := time.NewTicker(s.opts.RegisterInterval)
// only process if it exists // only process if it exists
if s.opts.RegisterInterval <= time.Duration(0) { if s.opts.RegisterInterval > time.Duration(0) {
t.C = nil // new ticker
t = time.NewTicker(s.opts.RegisterInterval)
} }
// return error chan // return error chan