Skip to content

Commit

Permalink
fix: fix pagination bug
Browse files Browse the repository at this point in the history
logic error caused pagination to skip some records
  • Loading branch information
philnagel committed Aug 14, 2023
1 parent ca62064 commit 3b72eef
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions restapi/common_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,6 @@ def query(self, where='1=1', fields='*', records=None, exceed_limit=False, fetch
params[RESULT_RECORD_COUNT] = records

server_response = self.request(query_url, params)

return self._format_server_response(server_response, records)

def query_in_chunks(self, where='1=1', fields='*', records=None, **kwargs):
Expand Down Expand Up @@ -1783,7 +1782,7 @@ def query_in_chunks(self, where='1=1', fields='*', records=None, **kwargs):
more = True
while more:
next_resp = self.request(query_url, params)
params[RESULTOFFSET] = params.get(RESULTOFFSET, max_recs) + max_recs
params[RESULTOFFSET] = params.get(RESULTOFFSET, 0) + max_recs
params[RESULT_RECORD_COUNT] = max_recs
more = next_resp.get(EXCEED_TRANSFER_LIMIT)
yield next_resp
Expand Down

0 comments on commit 3b72eef

Please sign in to comment.