Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions releases/unreleased/pagination-error-fixed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Pagination error fixed
category: fixed
author: Santiago Dueñas <sduenas@bitergia.com>
issue: null
notes: >
Pagination wasn't done right. The backend did not
use the right parameters to check when it have
reached the last page of accounts.
7 changes: 4 additions & 3 deletions sortinghat/core/importer/backends/eclipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,8 @@ def fetch_accounts(self, epoch):
url = f"{self.ECLIPSE_ACCOUNTS_URL}/account/updated"
params = {
'since': epoch,
'page': page
'page': page,
'pagesize': 100,
}

logger.debug(f"Fetching accounts from API; url={url}, params={params}")
Expand All @@ -259,9 +260,9 @@ def fetch_accounts(self, epoch):
naccounts = len(data['result'])
total_accounts += naccounts

logger.debug(f"Accounts from API fetched; url={url}, params={params}, naccounts={naccounts}")
logger.info(f"Accounts from API fetched; url={url}, params={params}, naccounts={naccounts}")

if page >= data['pagination']['result_end']:
if data['pagination']['result_size'] == 0:
break

page += 1
Expand Down