Skip to content

Commit

Permalink
fix: Test Connection Lock (#3172)
Browse files Browse the repository at this point in the history
fix: test connection lock
  • Loading branch information
xoscar authored Sep 21, 2023
1 parent 126f909 commit 96510f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/http/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,6 @@ func (c *controller) TestConnection(ctx context.Context, dataStore openapi.DataS
wg := sync.WaitGroup{}
err := c.dsTestPipeline.Subscribe(job.ID, func(result testconnection.Job) {
job = result
c.dsTestPipeline.Unsubscribe(job.ID)
wg.Done()
})

Expand All @@ -702,6 +701,7 @@ func (c *controller) TestConnection(ctx context.Context, dataStore openapi.DataS
c.dsTestPipeline.Run(ctx, job)
wg.Add(1)
wg.Wait()
c.dsTestPipeline.Unsubscribe(job.ID)

if err := ds.Validate(); err != nil {
return openapi.Response(http.StatusBadRequest, err.Error()), err
Expand Down

0 comments on commit 96510f2

Please sign in to comment.