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:
parent
a5015692e3
commit
e22fa01935
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user