diff --git a/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs b/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs index 7c8f8b62..2e18950f 100644 --- a/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs +++ b/Oqtane.Server/Infrastructure/Jobs/NotificationJob.cs @@ -20,11 +20,15 @@ namespace Oqtane.Infrastructure { string log = ""; - // iterate through aliases in this installation + // iterate through tenants in this installation + List tenants = new List(); var aliasRepository = provider.GetRequiredService(); List aliases = aliasRepository.GetAliases().ToList(); foreach (Alias alias in aliases) { + if (tenants.Contains(alias.TenantId)) continue; + tenants.Add(alias.TenantId); + // use the SiteState to set the Alias explicitly so the tenant can be resolved var siteState = provider.GetRequiredService(); siteState.Alias = alias; @@ -34,7 +38,7 @@ namespace Oqtane.Infrastructure var settingRepository = provider.GetRequiredService(); var notificationRepository = provider.GetRequiredService(); - // iterate through sites + // iterate through sites for this tenant List sites = siteRepository.GetSites().ToList(); foreach (Site site in sites) {