Batch NORDN pull queue task deletions

They were failing because the maximum App Engine task batch size is 1,000, and
we currently have more than 4,000 tasks in the pull queue. We keep re-uploading
those to NORDN because we're unable to delete the tasks after successful upload,
so the leases expire and they get processed again.

Also renames TaskEnqueuer to TaskQueueUtils to reflect its newly expanded role.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197060903
This commit is contained in:
mcilwain 2018-05-17 15:22:34 -07:00 committed by jianglai
parent 1248a7722b
commit c989911526
21 changed files with 129 additions and 73 deletions

View file

@ -43,7 +43,7 @@ import google.registry.request.RequestParameters;
import google.registry.request.Response;
import google.registry.request.auth.Auth;
import google.registry.util.FormattingLogger;
import google.registry.util.TaskEnqueuer;
import google.registry.util.TaskQueueUtils;
import java.util.Optional;
import java.util.Random;
import java.util.stream.Stream;
@ -103,7 +103,7 @@ public final class TldFanoutAction implements Runnable {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
@Inject TaskEnqueuer taskEnqueuer;
@Inject TaskQueueUtils taskQueueUtils;
@Inject Response response;
@Inject @Parameter(ENDPOINT_PARAM) String endpoint;
@Inject @Parameter(QUEUE_PARAM) String queue;
@ -144,7 +144,7 @@ public final class TldFanoutAction implements Runnable {
}
for (String tld : tlds) {
TaskOptions taskOptions = createTaskOptions(tld, flowThruParams);
TaskHandle taskHandle = taskEnqueuer.enqueue(taskQueue, taskOptions);
TaskHandle taskHandle = taskQueueUtils.enqueue(taskQueue, taskOptions);
outputPayload.append(
String.format(
"- Task: '%s', tld: '%s', endpoint: '%s'\n",