Merge pull request #1140 from jakedt/fixallocator
Fix the allocator to use id ranges instead of limits
This commit is contained in:
commit
9583b715bd
1 changed files with 2 additions and 2 deletions
|
@ -133,8 +133,8 @@ def yield_random_entries(batch_query, primary_key_field, batch_size, max_id):
|
||||||
while True:
|
while True:
|
||||||
start_index = allocator.get_block_start_index(batch_size)
|
start_index = allocator.get_block_start_index(batch_size)
|
||||||
all_candidates = list(batch_query()
|
all_candidates = list(batch_query()
|
||||||
.limit(batch_size)
|
.where(primary_key_field >= start_index,
|
||||||
.where(primary_key_field >= start_index))
|
primary_key_field <= start_index + batch_size))
|
||||||
|
|
||||||
if len(all_candidates) == 0:
|
if len(all_candidates) == 0:
|
||||||
logger.info('No candidates, new highest id: %s', start_index)
|
logger.info('No candidates, new highest id: %s', start_index)
|
||||||
|
|
Reference in a new issue