Merge pull request #643 from chlupac/Notifications

Notification job optimalization
This commit is contained in:
Shaun Walker 2020-07-03 15:16:14 -04:00 committed by GitHub
commit 921cced1c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,8 +38,10 @@ namespace Oqtane.Infrastructure
List<Site> sites = siteRepository.GetSites().ToList();
foreach (Site site in sites)
{
List<Notification> notifications = notificationRepository.GetNotifications(site.SiteId, -1, -1).ToList();
if (!notifications.Any()) continue; //Nothing to do.
log += "Processing Notifications For Site: " + site.Name + "\n\n";
// get site settings
List<Setting> sitesettings = settingRepository.GetSettings(EntityNames.Site, site.SiteId).ToList();
Dictionary<string, string> settings = GetSettings(sitesettings);
@ -61,7 +63,6 @@ namespace Oqtane.Infrastructure
// iterate through notifications
int sent = 0;
List<Notification> notifications = notificationRepository.GetNotifications(site.SiteId, -1, -1).ToList();
foreach (Notification notification in notifications)
{
MailMessage mailMessage = new MailMessage();