Skip to content

Commit

Permalink
Removed the ratelimitting for rows (will only be capped by the max ro…
Browse files Browse the repository at this point in the history
…ws limit)
  • Loading branch information
romanchyla committed Jul 5, 2019
1 parent 28bb9ab commit 1e5d648
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 2 additions & 3 deletions solr/tests/unittests/test_solr.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ def test_cleanup_params(self):

def test_set_max_rows(self):
"""
solr should only return up to a default number of documents multiplied
by the user's ratelimit-level, if applicable
solr should only return up to a default number of documents
"""
with MockSolrResponse(self.app.config.get('SOLR_SERVICE_SEARCH_HANDLER')):

Expand All @@ -286,7 +285,7 @@ def test_set_max_rows(self):
query_string={'q': '*', 'rows': 10},
headers={'X-Adsws-Ratelimit-Level': '10'}
)
self.assertEqual(len(r.json['response']['docs']), 7)
self.assertEqual(len(r.json['response']['docs']), 2)


def test_docs_subquery(self):
Expand Down
3 changes: 0 additions & 3 deletions solr/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ 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 *= float(
request.headers.get('X-Adsws-Ratelimit-Level', 1.0)
)
max_rows = int(max_rows)


Expand Down

0 comments on commit 1e5d648

Please sign in to comment.