mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +02: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:
parent
1dfb6afa4b
commit
01bb3a30f2
1 changed files with 4 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue