Skip to content

Commit

Permalink
RHINENG-9505: use individual contex for candlepin call
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka committed Sep 11, 2024
1 parent 1ad8572 commit 39798ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manager/controllers/template_systems_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TemplateSystemsDeleteHandler(c *gin.Context) {
return
}

err = assignCandlepinEnvironment(c, db, account, nil, req.Systems, groups)
err = assignCandlepinEnvironment(db, account, nil, req.Systems, groups)
if err != nil {
return
}
Expand Down
6 changes: 3 additions & 3 deletions manager/controllers/template_systems_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TemplateSystemsUpdateHandler(c *gin.Context) {
return
}

err = assignCandlepinEnvironment(c, db, account, &template.EnvironmentID, req.Systems, groups)
err = assignCandlepinEnvironment(db, account, &template.EnvironmentID, req.Systems, groups)
if err != nil {
return
}
Expand Down Expand Up @@ -193,7 +193,7 @@ func callCandlepin(ctx context.Context, consumer string, request *candlepin.Cons
return candlepinRespPtr.(*candlepin.ConsumersUpdateResponse), nil
}

func assignCandlepinEnvironment(c context.Context, db *gorm.DB, accountID int, env *string, inventoryIDs []string,
func assignCandlepinEnvironment(db *gorm.DB, accountID int, env *string, inventoryIDs []string,
groups map[string]string) error {
var consumers = []struct {
InventoryID string
Expand All @@ -219,7 +219,7 @@ func assignCandlepinEnvironment(c context.Context, db *gorm.DB, accountID int, e
err = errors2.Join(err, errors.Errorf("Missing owner_id for '%s'", consumer.InventoryID))
continue
}
resp, apiErr := callCandlepin(c, *consumer.Consumer, &updateReq)
resp, apiErr := callCandlepin(base.Context, *consumer.Consumer, &updateReq)
// check response
if apiErr != nil {
err = errors2.Join(err, apiErr, errors.New(resp.Message))
Expand Down

0 comments on commit 39798ae

Please sign in to comment.