Skip to content

Commit

Permalink
Close manager request body
Browse files Browse the repository at this point in the history
  • Loading branch information
jirwin committed May 15, 2023
1 parent 4ec75ee commit 597f22f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/connector/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (o *userResourceType) userTrait(ctx context.Context, user *jcapi1.Systemuse
profile.Fields["manager_id"] = structpb.NewStringValue(managerID)
manager, ok = o.managers[managerID]
if !ok {
m, _, err := client.SystemusersApi.SystemusersGet(ctx, managerID).Execute()
m, resp, err := client.SystemusersApi.SystemusersGet(ctx, managerID).Execute()
if err != nil {
l.Error(
"baton-jumpcloud: failed to fetch manager details",
Expand All @@ -138,6 +138,8 @@ func (o *userResourceType) userTrait(ctx context.Context, user *jcapi1.Systemuse
zap.String("manager_id", managerID),
)
}
defer resp.Body.Close()

manager = m
o.managers[user.GetManager()] = m
}
Expand Down

0 comments on commit 597f22f

Please sign in to comment.