Skip to content

Commit 3ef64be

Browse files
authored
Added a rate limiter for getting the overall list of Postman workspaces (#4002)
1 parent 793c09d commit 3ef64be

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/sources/postman/postman_client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ func (c *Client) EnumerateWorkspaces(ctx context.Context) ([]Workspace, error) {
271271
Workspaces []Workspace `json:"workspaces"`
272272
}{}
273273

274+
if err := c.WorkspaceAndCollectionRateLimiter.Wait(ctx); err != nil {
275+
return nil, fmt.Errorf("could not wait for rate limiter during workspaces enumeration getting: %w", err)
276+
}
274277
r, err := c.getPostmanReq("https://api.getpostman.com/workspaces", nil)
275278
if err != nil {
276279
return nil, fmt.Errorf("could not get workspaces during enumeration: %w", err)

0 commit comments

Comments
 (0)