From 8c373348ae8b178ace4c0b5dff27713c1f8a5ae9 Mon Sep 17 00:00:00 2001 From: Jason Collins <47123298+jcollins-axway@users.noreply.github.com> Date: Mon, 17 Oct 2022 14:55:03 -0700 Subject: [PATCH] APIGOV-23900 - remove wait groups that are not needed at the moment (#570) --- pkg/agent/agent.go | 4 ---- pkg/agent/discovery.go | 3 --- pkg/agent/instancevalidator.go | 3 --- 3 files changed, 10 deletions(-) diff --git a/pkg/agent/agent.go b/pkg/agent/agent.go index 999a5b921..e5e377604 100644 --- a/pkg/agent/agent.go +++ b/pkg/agent/agent.go @@ -70,8 +70,6 @@ type agentData struct { marketplaceMigration migrate.Migrator streamer *stream.StreamerClient authProviderRegistry oauth.ProviderRegistry - publishingGroup sync.WaitGroup // wait group to block validator from publishing is happening - validatingGroup sync.WaitGroup // wait group to block publishing while validator is running // profiling profileDone chan struct{} @@ -200,8 +198,6 @@ func handleCentralConfig(centralCfg config.CentralConfig) error { } func handleInitialization() error { - agent.publishingGroup = sync.WaitGroup{} - agent.validatingGroup = sync.WaitGroup{} setupSignalProcessor() // only do the periodic health check stuff if NOT in unit tests and running binary agents if util.IsNotTest() && !isRunningInDockerContainer() { diff --git a/pkg/agent/discovery.go b/pkg/agent/discovery.go index 20f4a09c1..02fecb392 100644 --- a/pkg/agent/discovery.go +++ b/pkg/agent/discovery.go @@ -117,9 +117,6 @@ func GetOwnerOnPublishedAPIByPrimaryKey(primaryKey string) *apiV1.Owner { // PublishAPI - Publishes the API func PublishAPI(serviceBody apic.ServiceBody) error { - agent.validatingGroup.Wait() - agent.publishingGroup.Add(1) - defer agent.publishingGroup.Done() if agent.apicClient != nil { if agent.agentFeaturesCfg.MarketplaceProvisioningEnabled() { var err error diff --git a/pkg/agent/instancevalidator.go b/pkg/agent/instancevalidator.go index dfea7f418..661294a1f 100644 --- a/pkg/agent/instancevalidator.go +++ b/pkg/agent/instancevalidator.go @@ -41,9 +41,6 @@ func (j *instanceValidator) Status() error { // Execute - func (j *instanceValidator) Execute() error { if getAPIValidator() != nil { - agent.publishingGroup.Wait() - agent.validatingGroup.Add(1) - defer agent.validatingGroup.Done() j.validateAPIOnDataplane() }