svcListCacheMtx.Lock()
defer svcListCacheMtx.Unlock()
for _, ent := range svcListCache {
- ent.clear <- struct{}{}
+ select {
+ case ent.clear <- struct{}{}:
+ default:
+ }
}
}
arv := *kc.Arvados
cacheEnt = cachedSvcList{
latest: make(chan svcList),
- clear: make(chan struct{}),
+ clear: make(chan struct{}, 1),
arv: &arv,
}
go cacheEnt.poll()