From b67b1e90fd75cf05e2d611a4b7c0cb9f790c91a9 Mon Sep 17 00:00:00 2001 From: Yvonnick Esnault Date: Fri, 3 May 2019 09:30:35 +0200 Subject: [PATCH] fix(hatchery): break on already registering (#4248) Signed-off-by: Yvonnick Esnault --- sdk/hatchery/register.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/hatchery/register.go b/sdk/hatchery/register.go index 6fbf316ad4..2b6e74f4d4 100644 --- a/sdk/hatchery/register.go +++ b/sdk/hatchery/register.go @@ -29,6 +29,7 @@ func workerRegister(ctx context.Context, h Interface, startWorkerChan chan<- wor } atomic.StoreInt64(&nbRegisteringWorkerModels, int64(len(currentRegistering))) +loopModels: for k := range models { if models[k].Type != h.ModelType() { continue @@ -57,7 +58,7 @@ func workerRegister(ctx context.Context, h Interface, startWorkerChan chan<- wor for _, w := range currentRegistering { if strings.Contains(w.Name, models[k].Name) { log.Info("hatchery> workerRegister> %s is already registering (%s)", models[k].Name, w.Name) - continue + continue loopModels } }