mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-14 19:04:51 +08:00
Update TaxonomyService.cs
This commit is contained in:
@@ -30,6 +30,7 @@ namespace Orchard.Taxonomies.Services {
|
||||
private readonly ShellSettings _shellSettings;
|
||||
private readonly IShellDescriptorManager _shellDescriptorManager;
|
||||
|
||||
private readonly HashSet<int> _processedTermParts = new HashSet<int>();
|
||||
|
||||
public TaxonomyService(
|
||||
IRepository<TermContentItem> termContentItemRepository,
|
||||
@@ -266,8 +267,13 @@ namespace Orchard.Taxonomies.Services {
|
||||
}
|
||||
|
||||
var termPartRecordIds = termList.Select(t => t.Term.TermRecord.Id).ToArray();
|
||||
if (termPartRecordIds.Length > 0) {
|
||||
_processingEngine.AddTask(_shellSettings, _shellDescriptorManager.GetShellDescriptor(), "ITermCountProcessor.Process", new Dictionary<string, object> { { "termPartRecordIds", termPartRecordIds } });
|
||||
if (termPartRecordIds.Any()) {
|
||||
if (!_processedTermParts.Any()) {
|
||||
_processingEngine.AddTask(_shellSettings, _shellDescriptorManager.GetShellDescriptor(), "ITermCountProcessor.Process", new Dictionary<string, object> { { "termPartRecordIds", _processedTermParts } });
|
||||
}
|
||||
foreach (var termPartRecordId in termPartRecordIds) {
|
||||
_processedTermParts.Add(termPartRecordId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user