From 748cc2dac15a114774cb51bffbb6b269bf2a6458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Jochum?= Date: Fri, 23 Sep 2022 04:11:32 +0200 Subject: [PATCH] Fix context Deadlines by using a new context on each loop --- cmd/microrouterd/handler/handler.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/microrouterd/handler/handler.go b/cmd/microrouterd/handler/handler.go index 2d52b2c..bde3ebc 100644 --- a/cmd/microrouterd/handler/handler.go +++ b/cmd/microrouterd/handler/handler.go @@ -48,9 +48,9 @@ func (h *Handler) Init(service micro.Service, engine *gin.Engine, routerAuth aut // Refresh routes for the proxy every 10 seconds go func() { - ctx := context.Background() - for { + ctx := context.Background() + services, err := util.FindByEndpoint(h.service, "RouterClientService.Routes") if err != nil { ilogger.Logrus().Error(err)