From 4553422ade92c258e895f4c3335a09710e99103b Mon Sep 17 00:00:00 2001 From: cgoldfeder Date: Tue, 25 Apr 2017 09:08:25 -0700 Subject: [PATCH] Move domainCreateFailfast before cloneAndLinkReferences This avoids loading all contacts and hosts before the failfast runs ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=154179321 --- java/google/registry/flows/domain/DomainAllocateFlow.java | 2 +- .../registry/flows/domain/DomainApplicationCreateFlow.java | 2 +- java/google/registry/flows/domain/DomainCreateFlow.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/google/registry/flows/domain/DomainAllocateFlow.java b/java/google/registry/flows/domain/DomainAllocateFlow.java index 2c907d186..52898200c 100644 --- a/java/google/registry/flows/domain/DomainAllocateFlow.java +++ b/java/google/registry/flows/domain/DomainAllocateFlow.java @@ -139,8 +139,8 @@ public class DomainAllocateFlow implements TransactionalFlow { validateClientIsLoggedIn(clientId); verifyIsSuperuser(); DateTime now = ofy().getTransactionTime(); - Create command = cloneAndLinkReferences((Create) resourceCommand, now); failfastForCreate(targetId, now); + Create command = cloneAndLinkReferences((Create) resourceCommand, now); verifyResourceDoesNotExist(DomainResource.class, targetId, now); InternetDomainName domainName = validateDomainName(command.getFullyQualifiedDomainName()); Registry registry = Registry.get(domainName.parent().toString()); diff --git a/java/google/registry/flows/domain/DomainApplicationCreateFlow.java b/java/google/registry/flows/domain/DomainApplicationCreateFlow.java index b047c7590..d92cf551f 100644 --- a/java/google/registry/flows/domain/DomainApplicationCreateFlow.java +++ b/java/google/registry/flows/domain/DomainApplicationCreateFlow.java @@ -195,8 +195,8 @@ public final class DomainApplicationCreateFlow implements TransactionalFlow { extensionManager.validate(); validateClientIsLoggedIn(clientId); DateTime now = ofy().getTransactionTime(); - Create command = cloneAndLinkReferences((Create) resourceCommand, now); failfastForCreate(targetId, now); + Create command = cloneAndLinkReferences((Create) resourceCommand, now); // Fail if the domain is already registered (e.g. this is a landrush application but the domain // was awarded at the end of sunrise). However, multiple domain applications can be created for // the same domain name, so don't try to load an existing application. diff --git a/java/google/registry/flows/domain/DomainCreateFlow.java b/java/google/registry/flows/domain/DomainCreateFlow.java index be148d61f..b30271a48 100644 --- a/java/google/registry/flows/domain/DomainCreateFlow.java +++ b/java/google/registry/flows/domain/DomainCreateFlow.java @@ -193,12 +193,12 @@ public class DomainCreateFlow implements TransactionalFlow { extensionManager.validate(); validateClientIsLoggedIn(clientId); DateTime now = ofy().getTransactionTime(); + failfastForCreate(targetId, now); Create command = cloneAndLinkReferences((Create) resourceCommand, now); Period period = command.getPeriod(); verifyUnitIsYears(period); int years = period.getValue(); validateRegistrationPeriod(years); - failfastForCreate(targetId, now); verifyResourceDoesNotExist(DomainResource.class, targetId, now); // Validate that this is actually a legal domain name on a TLD that the registrar has access to. InternetDomainName domainName = validateDomainName(command.getFullyQualifiedDomainName());