diff --git a/cluster/router/chain/chain.go b/cluster/router/chain/chain.go index 952aedf92d70d92b3b029a9809826295e1cc7dc5..252093af0b52873281511b5fa6d50cc8bb685d52 100644 --- a/cluster/router/chain/chain.go +++ b/cluster/router/chain/chain.go @@ -125,8 +125,8 @@ func (c *RouterChain) SetInvokers(invokers []protocol.Invoker) { // loop listens on events to update the address cache when it's necessary, either when it receives notification // from address update, or when timeInterval exceeds. func (c *RouterChain) loop() { + ticker := time.NewTicker(timeInterval) for { - ticker := time.NewTicker(timeInterval) select { case <-ticker.C: c.buildCache()