Skip to content

Commit

Permalink
Abort domain cache refreshment retry during shutdown (uber#2672)
Browse files Browse the repository at this point in the history
* Abort domain cache refreshment retry during shutdown
  • Loading branch information
yux0 authored Oct 16, 2019
1 parent df19cca commit 6c8d531
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions common/cache/domainCache.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,13 @@ func (c *domainCache) refreshLoop() {
return
case <-timer.C:
for err := c.refreshDomains(); err != nil; err = c.refreshDomains() {
c.logger.Error("Error refreshing domain cache", tag.Error(err))
time.Sleep(DomainCacheRefreshFailureRetryInterval)
select {
case <-c.shutdownChan:
return
default:
c.logger.Error("Error refreshing domain cache", tag.Error(err))
time.Sleep(DomainCacheRefreshFailureRetryInterval)
}
}
}
}
Expand Down

0 comments on commit 6c8d531

Please sign in to comment.