Remove transition code from []

The parameters were optional during the transition to allow old jobs stuck in the queue to work properly. It's been 2 months now so it's time to end the transition.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190235532
This commit is contained in:
guyben 2018-03-23 10:10:00 -07:00 committed by jianglai
parent 785225fc28
commit 89d8ba93f2
5 changed files with 29 additions and 34 deletions

View file

@ -218,7 +218,7 @@ public final class ReadDnsQueueAction implements Runnable {
* tasks for paused TLDs or tasks for TLDs not part of {@link Registries#getTlds()}.
*/
private void dispatchTasks(ImmutableSet<TaskHandle> tasks, ImmutableSet<String> tlds) {
ClassifiedTasks classifiedTasks = classifyTasks(tasks, tlds, clock.nowUtc());
ClassifiedTasks classifiedTasks = classifyTasks(tasks, tlds);
if (!classifiedTasks.pausedTlds().isEmpty()) {
logger.infofmt("The dns-pull queue is paused for TLDs: %s.", classifiedTasks.pausedTlds());
}
@ -255,7 +255,7 @@ public final class ReadDnsQueueAction implements Runnable {
* taken on them) or in no category (if no action is to be taken on them)
*/
private static ClassifiedTasks classifyTasks(
ImmutableSet<TaskHandle> tasks, ImmutableSet<String> tlds, DateTime now) {
ImmutableSet<TaskHandle> tasks, ImmutableSet<String> tlds) {
ClassifiedTasks.Builder classifiedTasksBuilder = ClassifiedTasks.builder();
@ -263,14 +263,7 @@ public final class ReadDnsQueueAction implements Runnable {
for (TaskHandle task : tasks) {
try {
Map<String, String> params = ImmutableMap.copyOf(task.extractParams());
// We allow 'null' create-time for the transition period - and during that time we set the
// create-time to "now".
//
// TODO(b/73343464):remove support for null create-time once transition is over.
DateTime creationTime =
Optional.ofNullable(params.get(DNS_TARGET_CREATE_TIME_PARAM))
.map(DateTime::parse)
.orElse(now);
DateTime creationTime = DateTime.parse(params.get(DNS_TARGET_CREATE_TIME_PARAM));
String tld = params.get(RequestParameters.PARAM_TLD);
if (tld == null) {
logger.severefmt("Discarding invalid DNS refresh request %s; no TLD specified.", task);