X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/060d38d627bd1e51dd2b3c6e7de9af6aa7d7b6f3..8d73164d5ca50e7af1b3752b4251eaf9f11a9fc8:/sdk/go/keepclient/discover.go diff --git a/sdk/go/keepclient/discover.go b/sdk/go/keepclient/discover.go index 2140dceabb..4377c19515 100644 --- a/sdk/go/keepclient/discover.go +++ b/sdk/go/keepclient/discover.go @@ -22,9 +22,15 @@ import ( func RefreshServiceDiscovery() { svcListCacheMtx.Lock() defer svcListCacheMtx.Unlock() + var wg sync.WaitGroup for _, ent := range svcListCache { - ent.clear <- struct{}{} + wg.Add(1) + go func() { + ent.clear <- struct{}{} + wg.Done() + }() } + wg.Wait() } // ClearCacheOnSIGHUP installs a signal handler that calls