perf(templateengine): alarm-override, folder-delete and template-delete checks read lean template projections (review 2026-10-21 04/P6, 08/P1)
InstanceService.SetAlarmOverrideAsync and TemplateDeletionService move to the no-tracking, body-free GetAllTemplatesForAnalysisAsync; TemplateFolderService counts folder contents from GetTemplateStubsAsync.
This commit is contained in:
@@ -232,7 +232,9 @@ public class TemplateFolderService
|
||||
return Result<bool>.Failure($"Folder with ID {folderId} not found.");
|
||||
|
||||
var allFolders = await _repository.GetAllFoldersAsync(cancellationToken);
|
||||
var allTemplates = await _repository.GetAllTemplatesAsync(cancellationToken);
|
||||
// Only FolderId is read — the untracked identity projection, not the full
|
||||
// template graph with every script body (review 2026-10-21 04/P6, 08/P1).
|
||||
var allTemplates = await _repository.GetTemplateStubsAsync(cancellationToken);
|
||||
|
||||
var childFolderCount = allFolders.Count(f => f.ParentFolderId == folderId);
|
||||
var childTemplateCount = allTemplates.Count(t => t.FolderId == folderId);
|
||||
|
||||
Reference in New Issue
Block a user