Skip to content

Commit

Permalink
VP-5334 Call ClearCache before publish event (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliveMen authored Oct 13, 2020
1 parent b238efb commit 6824d03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ public virtual async Task SavePlansAsync(PaymentPlan[] plans)
await _eventPublisher.Publish(new PaymentPlanChangingEvent(changedEntries));
await repository.UnitOfWork.CommitAsync();
pkMap.ResolvePrimaryKeys();

ClearCacheFor(plans);

await _eventPublisher.Publish(new PaymentPlanChangedEvent(changedEntries));
}

ClearCacheFor(plans);
}

public virtual async Task DeleteAsync(string[] ids)
Expand All @@ -104,10 +105,10 @@ public virtual async Task DeleteAsync(string[] ids)
await repository.RemovePaymentPlansByIdsAsync(ids);
await repository.UnitOfWork.CommitAsync();

ClearCacheFor(paymentPlans);

await _eventPublisher.Publish(new PaymentPlanChangedEvent(changedEntries));
}

ClearCacheFor(paymentPlans);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,11 @@ public virtual async Task SaveSubscriptionsAsync(Subscription[] subscriptions)
await _eventPublisher.Publish(new SubscriptionChangingEvent(changedEntries));
await repository.UnitOfWork.CommitAsync();
pkMap.ResolvePrimaryKeys();

ClearCacheFor(subscriptions);

await _eventPublisher.Publish(new SubscriptionChangedEvent(changedEntries));
}

ClearCacheFor(subscriptions);
}

public virtual async Task DeleteAsync(string[] ids)
Expand All @@ -176,9 +177,9 @@ public virtual async Task DeleteAsync(string[] ids)
await repository.RemoveSubscriptionsByIdsAsync(ids);
await repository.UnitOfWork.CommitAsync();

await _eventPublisher.Publish(new SubscriptionChangedEvent(changedEntries));

ClearCacheFor(subscriptions);

await _eventPublisher.Publish(new SubscriptionChangedEvent(changedEntries));
}
}
}
Expand Down

0 comments on commit 6824d03

Please sign in to comment.