Fix minor items on recurring billing expansion MR

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126060671
This commit is contained in:
ctingue 2016-06-28 04:45:51 -07:00 committed by Ben McIlwain
parent 372bf5718e
commit 65f920594b
2 changed files with 13 additions and 3 deletions

View file

@ -203,7 +203,12 @@ public class ExpandRecurringBillingEventsAction implements Runnable {
getContext().incrementCounter("error: " + t.getClass().getSimpleName());
getContext().incrementCounter(ERROR_COUNTER);
}
if (!isDryRun) {
getContext().incrementCounter("Saved OneTime billing events", billingEventsSaved);
} else {
getContext().incrementCounter(
"Generated OneTime billing events (dry run)", billingEventsSaved);
}
}
/**
@ -236,7 +241,10 @@ public class ExpandRecurringBillingEventsAction implements Runnable {
.filter(new Predicate<BillingEvent.OneTime>() {
@Override
public boolean apply(OneTime billingEvent) {
return billingEvent.getCancellationMatchingBillingEvent().equals(
Key<? extends BillingEvent> cancellationMatchingBillingEvent =
billingEvent.getCancellationMatchingBillingEvent();
return cancellationMatchingBillingEvent != null
&& billingEvent.getCancellationMatchingBillingEvent().equals(
Key.create(recurringEvent));
}})
.transform(new Function<OneTime, DateTime>() {

View file

@ -21,6 +21,7 @@ import google.registry.backup.CommitLogCheckpointAction;
import google.registry.backup.DeleteOldCommitLogsAction;
import google.registry.backup.ExportCommitLogDiffAction;
import google.registry.backup.RestoreCommitLogsAction;
import google.registry.billing.ExpandRecurringBillingEventsAction;
import google.registry.cron.CommitLogFanoutAction;
import google.registry.cron.CronModule;
import google.registry.cron.TldFanoutAction;
@ -87,6 +88,7 @@ interface BackendRequestComponent {
DeleteHostResourceAction deleteHostResourceAction();
DeleteOldCommitLogsAction deleteOldCommitLogsAction();
DnsRefreshForHostRenameAction dnsRefreshForHostRenameAction();
ExpandRecurringBillingEventsAction expandRecurringBillingEventsAction();
ExportCommitLogDiffAction exportCommitLogDiffAction();
ExportDomainListsAction exportDomainListsAction();
ExportReservedTermsAction exportReservedTermsAction();