mirror of
https://github.com/google/nomulus
synced 2026-01-09 23:47:49 +00:00
Add asynchronous scheduled actions to re-save entities
This is used in the domain transfer and delete flows, both of which are asynchronous flows that have implicit default actions that will be taken at some point in the future. This CL adds scheduled re-saves to take place soon after those default actions would become effective, so that they can be re-saved quickly if so. Unfortunately the redemption grace period on our TLDs is 35 days, which exceeds the 30 day maximum task ETA in App Engine, so these won't actually fire. That's fine though; the deletion is actually effective as of 5 days, and this is just removing the grace period. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201345274
This commit is contained in:
@@ -42,6 +42,7 @@ import google.registry.flows.FlowModule.Superuser;
|
||||
import google.registry.flows.FlowModule.TargetId;
|
||||
import google.registry.flows.TransactionalFlow;
|
||||
import google.registry.flows.annotations.ReportingSpec;
|
||||
import google.registry.flows.async.AsyncFlowEnqueuer;
|
||||
import google.registry.flows.exceptions.AlreadyPendingTransferException;
|
||||
import google.registry.flows.exceptions.InvalidTransferPeriodValueException;
|
||||
import google.registry.flows.exceptions.ObjectAlreadySponsoredException;
|
||||
@@ -125,6 +126,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
||||
@Inject @Superuser boolean isSuperuser;
|
||||
@Inject HistoryEntry.Builder historyBuilder;
|
||||
@Inject Trid trid;
|
||||
@Inject AsyncFlowEnqueuer asyncFlowEnqueuer;
|
||||
@Inject EppResponse.Builder responseBuilder;
|
||||
@Inject DomainPricingLogic pricingLogic;
|
||||
@Inject DomainTransferRequestFlow() {}
|
||||
@@ -224,6 +226,7 @@ public final class DomainTransferRequestFlow implements TransactionalFlow {
|
||||
.setTransferData(pendingTransferData)
|
||||
.addStatusValue(StatusValue.PENDING_TRANSFER)
|
||||
.build();
|
||||
asyncFlowEnqueuer.enqueueAsyncResave(newDomain, now, automaticTransferTime);
|
||||
ofy().save()
|
||||
.entities(new ImmutableSet.Builder<>()
|
||||
.add(newDomain, historyEntry, requestPollMessage)
|
||||
|
||||
Reference in New Issue
Block a user