1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

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() {
// new ticker
t := time.NewTicker(s.opts.RegisterInterval)
t := new(time.Ticker)
// only process if it exists
if s.opts.RegisterInterval <= time.Duration(0) {
t.C = nil
if s.opts.RegisterInterval > time.Duration(0) {
// new ticker
t = time.NewTicker(s.opts.RegisterInterval)
}
// return error chan