mirror of
https://github.com/google/nomulus.git
synced 2025-05-20 03:09:33 +02: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:
parent
68c0f4647f
commit
9f548674b7
1 changed files with 4 additions and 1 deletions
|
@ -50,6 +50,7 @@ public class CreateGroupsAction implements Runnable {
|
||||||
public static final String CLIENT_ID_PARAM = "clientId";
|
public static final String CLIENT_ID_PARAM = "clientId";
|
||||||
|
|
||||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||||
|
private static final int NUM_SIMULTANEOUS_CONNECTIONS = 5;
|
||||||
|
|
||||||
@Inject GroupsConnection groupsConnection;
|
@Inject GroupsConnection groupsConnection;
|
||||||
@Inject Response response;
|
@Inject Response response;
|
||||||
|
@ -66,7 +67,9 @@ public class CreateGroupsAction implements Runnable {
|
||||||
List<RegistrarContact.Type> types = asList(RegistrarContact.Type.values());
|
List<RegistrarContact.Type> types = asList(RegistrarContact.Type.values());
|
||||||
// Concurrently create the groups for each RegistrarContact.Type, collecting the results from
|
// 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).
|
// 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>>() {
|
new Function<RegistrarContact.Type, Optional<Exception>>() {
|
||||||
@Override
|
@Override
|
||||||
public Optional<Exception> apply(Type type) {
|
public Optional<Exception> apply(Type type) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue