Skip to content

Commit

Permalink
Revert changes in SendReminderEmailsJob to fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgriff committed Sep 30, 2024
1 parent d4b9138 commit 64694bd
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ private void SendReminderEmailsAction(string runId)

private void SendReminderEmailsForSectorType(SectorTypes sector, string runId, DateTime startTime)
{
var activeReportingYears = ReportingYearsHelper.GetReportingYears(sector);
var activeReportingYears = GetActiveReportingYears(sector);
foreach (int year in activeReportingYears)
{
if (IsAfterEarliestReminderForReportingYear(sector, year))
Expand Down Expand Up @@ -316,5 +316,12 @@ private static List<int> GetReminderEmailDays()
return reminderEmailDays;
}

private static List<int> GetActiveReportingYears(SectorTypes sectorType)
{
return ReportingYearsHelper.GetReportingYears()
.Where(year => GetDeadlineDateForReportingYear(sectorType, year) > VirtualDateTime.Now)
.ToList();
}

}
}

0 comments on commit 64694bd

Please sign in to comment.