From b2559e4515b90791cb18e9392fca53c56553316f Mon Sep 17 00:00:00 2001 From: Guiheux Steven Date: Mon, 31 May 2021 11:09:36 +0200 Subject: [PATCH] fix: use wrong unit (#5830) --- engine/cdn/unit_handler.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/cdn/unit_handler.go b/engine/cdn/unit_handler.go index 4baf1e1828..210fc75739 100644 --- a/engine/cdn/unit_handler.go +++ b/engine/cdn/unit_handler.go @@ -125,8 +125,9 @@ func (s *Service) postAdminResyncBackendWithDatabaseHandler() service.Handler { for _, u := range s.Units.Buffers { if u.ID() == unitID { + choosenUnit := u s.GoRoutines.Exec(context.Background(), "ResyncWithDB-"+unitID, func(ctx context.Context) { - u.ResyncWithDatabase(ctx, s.mustDBWithCtx(ctx), it, dryRun) + choosenUnit.ResyncWithDatabase(ctx, s.mustDBWithCtx(ctx), it, dryRun) }) } }