Fix SWHIndexingLister.db_partition_indices(); ensure partition size is not zero

when this lister is called for the first time, db_num_entries() may return
a null value, so the min() will also be zero, making the range() call crash.
This commit is contained in:
David Douard 2019-01-14 11:57:26 +01:00
parent 028ceca90d
commit 065d3a64fc

View file

@ -103,7 +103,7 @@ class SWHIndexingLister(SWHListerBase):
declare approximately equal-sized ranges of existing
repos
"""
n = self.db_num_entries()
n = max(self.db_num_entries(), 10)
partitions = []
partition_size = min(partition_size, n)