mirror of
https://github.com/google/nomulus
synced 2026-01-03 03:35:42 +00:00
Use fewer simultaneous connections to Directory API
Ten turns out to have been set too high; that will occasionally throw 500 Backend errors from the API (presumably having to do with rate-limiting). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117549363
This commit is contained in:
@@ -50,6 +50,7 @@ public class CreateGroupsAction implements Runnable {
|
||||
public static final String CLIENT_ID_PARAM = "clientId";
|
||||
|
||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||
private static final int NUM_SIMULTANEOUS_CONNECTIONS = 5;
|
||||
|
||||
@Inject GroupsConnection groupsConnection;
|
||||
@Inject Response response;
|
||||
@@ -66,7 +67,9 @@ public class CreateGroupsAction implements Runnable {
|
||||
List<RegistrarContact.Type> types = asList(RegistrarContact.Type.values());
|
||||
// Concurrently create the groups for each RegistrarContact.Type, collecting the results from
|
||||
// each call (which are either an Exception if it failed, or absent() if it succeeded).
|
||||
List<Optional<Exception>> results = Concurrent.transform(types,
|
||||
List<Optional<Exception>> results = Concurrent.transform(
|
||||
types,
|
||||
NUM_SIMULTANEOUS_CONNECTIONS,
|
||||
new Function<RegistrarContact.Type, Optional<Exception>>() {
|
||||
@Override
|
||||
public Optional<Exception> apply(Type type) {
|
||||
|
||||
Reference in New Issue
Block a user