From 7002026da5361afc5162d42d744b0ef24edf5d5a Mon Sep 17 00:00:00 2001 From: mcilwain Date: Fri, 9 Jun 2017 10:04:19 -0700 Subject: [PATCH] Finish async task metrics data migration Now that we've been live with the new code, all of the old tasks have been processed, and the fallback code to handle the situation of those fields not being specified is not necessary. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158530336 --- .../registry/batch/DeleteContactsAndHostsAction.java | 9 ++------- .../registry/batch/RefreshDnsOnHostRenameAction.java | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/java/google/registry/batch/DeleteContactsAndHostsAction.java b/java/google/registry/batch/DeleteContactsAndHostsAction.java index aa84f5e17..b47d7ee72 100644 --- a/java/google/registry/batch/DeleteContactsAndHostsAction.java +++ b/java/google/registry/batch/DeleteContactsAndHostsAction.java @@ -43,7 +43,6 @@ import static google.registry.util.PipelineUtils.createJobPath; import static java.math.RoundingMode.CEILING; import static java.util.concurrent.TimeUnit.DAYS; import static java.util.concurrent.TimeUnit.MINUTES; -import static org.joda.time.DateTimeZone.UTC; import com.google.appengine.api.taskqueue.LeaseOptions; import com.google.appengine.api.taskqueue.Queue; @@ -522,13 +521,9 @@ public class DeleteContactsAndHostsAction implements Runnable { .setIsSuperuser( Boolean.valueOf( checkNotNull(params.get(PARAM_IS_SUPERUSER), "Is superuser not specified"))) - // TODO(b/38386090): After push is completed and all old tasks are processed, change to: - // .setRequestedTime(DateTime.parse( - // checkNotNull(params.get(PARAM_REQUESTED_TIME), "Requested time not specified"))) .setRequestedTime( - (params.containsKey(PARAM_REQUESTED_TIME)) - ? DateTime.parse(params.get(PARAM_REQUESTED_TIME)) - : DateTime.now(UTC)) + DateTime.parse( + checkNotNull(params.get(PARAM_REQUESTED_TIME), "Requested time not specified"))) .setIsDeletionAllowed(doesResourceStateAllowDeletion(resource, now)) .setTask(task) .build(); diff --git a/java/google/registry/batch/RefreshDnsOnHostRenameAction.java b/java/google/registry/batch/RefreshDnsOnHostRenameAction.java index a54b8ab34..9858e6588 100644 --- a/java/google/registry/batch/RefreshDnsOnHostRenameAction.java +++ b/java/google/registry/batch/RefreshDnsOnHostRenameAction.java @@ -29,7 +29,6 @@ import static google.registry.util.DateTimeUtils.latestOf; import static google.registry.util.PipelineUtils.createJobPath; import static java.util.concurrent.TimeUnit.DAYS; import static java.util.concurrent.TimeUnit.MINUTES; -import static org.joda.time.DateTimeZone.UTC; import com.google.appengine.api.taskqueue.LeaseOptions; import com.google.appengine.api.taskqueue.Queue; @@ -301,13 +300,9 @@ public class RefreshDnsOnHostRenameAction implements Runnable { return new AutoValue_RefreshDnsOnHostRenameAction_DnsRefreshRequest.Builder() .setHostKey(hostKey) .setLastUpdateTime(host.getUpdateAutoTimestamp().getTimestamp()) - // TODO(b/38386090): After push is completed and all old tasks are processed, change to: - // .setRequestedTime(DateTime.parse( - // checkNotNull(params.get(PARAM_REQUESTED_TIME), "Requested time not specified"))) .setRequestedTime( - (params.containsKey(PARAM_REQUESTED_TIME)) - ? DateTime.parse(params.get(PARAM_REQUESTED_TIME)) - : DateTime.now(UTC)) + DateTime.parse( + checkNotNull(params.get(PARAM_REQUESTED_TIME), "Requested time not specified"))) .setIsRefreshNeeded(!isHostDeleted) .setTask(task) .build();