File tree Expand file tree Collapse file tree
sortinghat/core/importer/backends Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ title : Pagination error fixed
3+ category : fixed
4+ author : Santiago Dueñas <sduenas@bitergia.com>
5+ issue : null
6+ notes : >
7+ Pagination wasn't done right. The backend did not
8+ use the right parameters to check when it have
9+ reached the last page of accounts.
Original file line number Diff line number Diff line change @@ -247,7 +247,8 @@ def fetch_accounts(self, epoch):
247247 url = f"{ self .ECLIPSE_ACCOUNTS_URL } /account/updated"
248248 params = {
249249 'since' : epoch ,
250- 'page' : page
250+ 'page' : page ,
251+ 'pagesize' : 100 ,
251252 }
252253
253254 logger .debug (f"Fetching accounts from API; url={ url } , params={ params } " )
@@ -259,9 +260,9 @@ def fetch_accounts(self, epoch):
259260 naccounts = len (data ['result' ])
260261 total_accounts += naccounts
261262
262- logger .debug (f"Accounts from API fetched; url={ url } , params={ params } , naccounts={ naccounts } " )
263+ logger .info (f"Accounts from API fetched; url={ url } , params={ params } , naccounts={ naccounts } " )
263264
264- if page >= data ['pagination' ]['result_end' ] :
265+ if data ['pagination' ]['result_size' ] == 0 :
265266 break
266267
267268 page += 1
You can’t perform that action at this time.
0 commit comments