tasks: update to new swh.scheduler API
This commit is contained in:
parent
c81c7de88c
commit
af60301f3a
3 changed files with 9 additions and 9 deletions
4
debian/control
vendored
4
debian/control
vendored
|
@ -9,7 +9,7 @@ Build-Depends: debhelper (>= 9),
|
|||
python3-nose,
|
||||
python3-setuptools,
|
||||
python3-swh.core,
|
||||
python3-swh.scheduler (>= 0.0.10~),
|
||||
python3-swh.scheduler (>= 0.0.14~),
|
||||
python3-swh.storage (>= 0.0.76~),
|
||||
python3-vcversioner
|
||||
Standards-Version: 3.9.6
|
||||
|
@ -17,7 +17,7 @@ Homepage: https://forge.softwareheritage.org/diffusion/DLSGH/
|
|||
|
||||
Package: python3-swh.lister.github
|
||||
Architecture: all
|
||||
Depends: python3-swh.scheduler (>= 0.0.10~),
|
||||
Depends: python3-swh.scheduler (>= 0.0.14~),
|
||||
python3-swh.storage (>= 0.0.76~),
|
||||
${misc:Depends},
|
||||
${python3:Depends}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
swh.core
|
||||
swh.storage >= 0.0.76
|
||||
swh.scheduler >= 0.0.10
|
||||
swh.scheduler >= 0.0.14
|
||||
|
|
|
@ -44,26 +44,26 @@ class ListerTaskBase(Task, metaclass=AbstractTaskMeta):
|
|||
pass
|
||||
|
||||
@abc.abstractmethod
|
||||
def run(self):
|
||||
def run_task(self):
|
||||
pass
|
||||
|
||||
|
||||
class IndexingDiscoveryListerTask(ListerTaskBase):
|
||||
def run(self):
|
||||
def run_task(self):
|
||||
lister = self.new_lister()
|
||||
lister.run(min_index=lister.db_last_index(), max_index=None)
|
||||
return lister.run(min_index=lister.db_last_index(), max_index=None)
|
||||
|
||||
|
||||
class IndexingRangeListerTask(ListerTaskBase):
|
||||
def run(self, start, end):
|
||||
def run_task(self, start, end):
|
||||
lister = self.new_lister()
|
||||
lister.run(min_index=start, max_index=end)
|
||||
return lister.run(min_index=start, max_index=end)
|
||||
|
||||
|
||||
class IndexingRefreshListerTask(ListerTaskBase):
|
||||
GROUP_SPLIT = 10000
|
||||
|
||||
def run(self):
|
||||
def run_task(self):
|
||||
lister = self.new_lister()
|
||||
ranges = lister.db_partition_indices(self.GROUP_SPLIT)
|
||||
random.shuffle(ranges)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue