Skip to content

Commit

Permalink
Updated code checking to allow for fractions of ratelimits
Browse files Browse the repository at this point in the history
  • Loading branch information
romanchyla committed Sep 25, 2018
1 parent ad1b29d commit c52811d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions solr/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ def cleanup_solr_request(self, payload, user_id=None):

payload['wt'] = 'json'
max_rows = current_app.config.get('SOLR_SERVICE_MAX_ROWS', 100)
max_rows *= int(
request.headers.get('X-Adsws-Ratelimit-Level', 1)
max_rows *= float(
request.headers.get('X-Adsws-Ratelimit-Level', 1.0)
)

max_rows = int(max_rows)


# Ensure there is a single rows value and that it does not bypass the max rows limit
Expand Down

0 comments on commit c52811d

Please sign in to comment.