From 38af32f37c71c28baa2af6f85701152255f26cbc Mon Sep 17 00:00:00 2001 From: Nikita Vasiliev Date: Wed, 21 Apr 2021 23:11:57 +0300 Subject: [PATCH] Fix a deadlock --- app/proxy/health.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/proxy/health.go b/app/proxy/health.go index bd7cecf..eb5aa93 100644 --- a/app/proxy/health.go +++ b/app/proxy/health.go @@ -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()