Skip to content
Snippets Groups Projects
Verified Commit d5208915 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

swh.lister.core.paging_lister: Adding comments

parent 74d83752
No related branches found
Tags v2.6.2
No related merge requests found
......@@ -82,6 +82,8 @@ class PageByPageLister(SWHListerBase):
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
......
......@@ -54,12 +54,12 @@ class IncrementalGitLabLister(ListerTaskBase):
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 <x-total-pages>
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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment