Skip to content

Commit

Permalink
APIGOV-23900 - remove wait groups that are not needed at the moment (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcollins-axway authored Oct 17, 2022
1 parent d4f4d82 commit 8c37334
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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() {
Expand Down
3 changes: 0 additions & 3 deletions pkg/agent/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions pkg/agent/instancevalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 8c37334

Please sign in to comment.