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) }) } }