mirror of
https://github.com/google/nomulus
synced 2026-01-06 13:36:48 +00:00
Fix handling around size of batches of mapreduce entities to process
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=149562105
This commit is contained in:
@@ -172,9 +172,12 @@ public class MapreduceEntityCleanupAction implements Runnable {
|
||||
DateTime cutoffDate = clock.nowUtc().minusDays(defaultedDaysOld);
|
||||
Optional<String> cursor = Optional.absent();
|
||||
do {
|
||||
Optional<Integer> numJobsToRequest =
|
||||
Optional.fromNullable(
|
||||
numJobsToDelete.isPresent() ? numJobsToDelete.get() - numJobsProcessed : null);
|
||||
EligibleJobResults batch =
|
||||
mapreduceEntityCleanupUtil.findEligibleJobsByJobName(
|
||||
jobName.orNull(), cutoffDate, numJobsToDelete, force.or(false), cursor);
|
||||
jobName.orNull(), cutoffDate, numJobsToRequest, force.or(false), cursor);
|
||||
cursor = batch.cursor();
|
||||
// Individual batches can come back empty if none of the returned jobs meet the requirements
|
||||
// or if all jobs have been exhausted.
|
||||
|
||||
Reference in New Issue
Block a user