Fix recurring expansion when handling transferred or deleted domains

The recurring billing event expansion fails when handling domains that are transferred or deleted before the initial renew. Quietly ignore these recurring events.

(This one is distinct from [] in that this bug occurs when domains currently exist under new ownership.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=143594317
This commit is contained in:
ctingue 2017-01-04 14:13:21 -08:00 committed by Ben McIlwain
parent 8252e97dfb
commit 0cf62be403
2 changed files with 15 additions and 1 deletions

View file

@ -139,7 +139,9 @@ public class ExpandRecurringBillingEventsAction implements Runnable {
}
getContext().incrementCounter("Recurring billing events encountered");
// Ignore any recurring billing events that have yet to apply.
if (recurring.getEventTime().isAfter(executeTime)) {
if (recurring.getEventTime().isAfter(executeTime)
// This second case occurs when a domain is transferred or deleted before first renewal.
|| recurring.getRecurrenceEndTime().isBefore(recurring.getEventTime())) {
getContext().incrementCounter("Recurring billing events ignored");
return;
}