Skip to content

Commit

Permalink
Removing async
Browse files Browse the repository at this point in the history
  • Loading branch information
wAsnk committed Oct 4, 2023
1 parent 5248392 commit a67fa1b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public async Task<SmtpResult> SendAsync(MailMessage message)
return emailResult;
}

private async Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota)
private Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota)
{
var currentUsagePercentage = emailQuota.CurrentUsagePercentage(_emailQuotaService.GetEmailQuotaPerMonth());
if (!_emailQuotaService.ShouldSendReminderEmail(emailQuota, currentUsagePercentage)) return;
if (!_emailQuotaService.ShouldSendReminderEmail(emailQuota, currentUsagePercentage)) return Task.CompletedTask;

if (currentUsagePercentage >= 100)
{
Expand All @@ -73,7 +73,7 @@ private async Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota)
"EmailQuotaExceededError",
_emailQuotaSubjectService.GetExceededEmailSubject(),
currentUsagePercentage);
return;
return Task.CompletedTask;
}

SendQuotaEmail(
Expand All @@ -82,6 +82,7 @@ private async Task SendAlertEmailIfNecessaryAsync(EmailQuota emailQuota)
$"EmailQuotaWarning",
_emailQuotaSubjectService.GetWarningEmailSubject(currentUsagePercentage),
currentUsagePercentage);
return Task.CompletedTask;
}

private void SendQuotaEmail(
Expand Down

0 comments on commit a67fa1b

Please sign in to comment.