Skip to content

Commit

Permalink
Merge pull request #378 from onc-healthit/LANTERN-721-CHPL-API-Too-Ma…
Browse files Browse the repository at this point in the history
…ny-Requests

LANTERN-721: Increased the time delay between CHPL API Requests to 1.2 seconds
  • Loading branch information
vishnu-mettles authored Aug 8, 2024
2 parents 6eaae25 + 586625c commit 03a3142
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion endpointmanager/pkg/chplquerier/chplquerier.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ func makeCHPLURL(path string, queryArgs map[string]string, pageSize int, pageNum
func getJSON(ctx context.Context, client *http.Client, chplURL *url.URL, userAgent string) ([]byte, error) {
// request ceritified products list
// Adds a short delay between request
time.Sleep(time.Duration(500 * time.Millisecond))
// LANTERN-721: Increased the delay to 1.2 seconds since the CHPL API rate limit is one request per second
time.Sleep(time.Duration(1200 * time.Millisecond))
req, err := http.NewRequest("GET", chplURL.String(), nil)
if err != nil {
return nil, errors.Wrap(err, "creating http request failed")
Expand Down

0 comments on commit 03a3142

Please sign in to comment.