Fix a deadlock

This commit is contained in:
Nikita Vasiliev 2021-04-21 23:11:57 +03:00 committed by Umputun
parent 7e89e35e48
commit 38af32f37c

View File

@ -42,12 +42,11 @@ func (h *Http) healthHandler(w http.ResponseWriter, _ *http.Request) {
if m.PingURL == "" {
continue
}
sema <- struct{}{}
pinged++
wg.Add(1)
go func(m discovery.URLMapper) {
sema <- struct{}{}
defer func() {
<-sema
wg.Done()