diff --git a/swh/lister/core/paging_lister.py b/swh/lister/core/paging_lister.py --- a/swh/lister/core/paging_lister.py +++ b/swh/lister/core/paging_lister.py @@ -82,6 +82,8 @@ def check_existence(self, injected_repos): """Given a list of injected repos, check if we already have them. + Attribute 'instance' variable is assumed to be populated. + """ # FIXME: Implement the check return False diff --git a/swh/lister/gitlab/tasks.py b/swh/lister/gitlab/tasks.py --- a/swh/lister/gitlab/tasks.py +++ b/swh/lister/gitlab/tasks.py @@ -54,12 +54,12 @@ def new_lister(self, api_baseurl='https://gitlab.com/api/v4', instance='gitlab.com'): - # will invert the order of the lister's result + # assuming going forward in desc order, page 1 through return GitLabLister(instance=instance, api_baseurl=api_baseurl, sort='desc') def run_task(self, *args, **kwargs): lister = self.new_lister(*args, **kwargs) - # will check for existing data and exit when found - return lister.run(min_bound=None, max_bound=None, - check_existence=True) + total, _, _ = lister.get_pages_information() + # stopping as soon as existing origins for that instance are detected + return lister.run(min_bound=1, max_bound=total, check_existence=True)