Merge pull request #1140 from jakedt/fixallocator

Fix the allocator to use id ranges instead of limits
This commit is contained in:
Jake Moshenko 2016-01-12 15:24:41 -05:00
commit 9583b715bd

View file

@ -133,8 +133,8 @@ def yield_random_entries(batch_query, primary_key_field, batch_size, max_id):
while True:
start_index = allocator.get_block_start_index(batch_size)
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:
logger.info('No candidates, new highest id: %s', start_index)