From ba4f99535e217298aa4d5a280ed6c7a3fe597663 Mon Sep 17 00:00:00 2001 From: samatrhea Date: Sun, 24 Dec 2023 13:43:27 +0100 Subject: [PATCH] [SQ - Improvements] logging and use of concrete class over interface for performance improvement --- CometServer/Modules/10-25/EngineeringModelApi.cs | 4 ++-- CometServer/Modules/10-25/ExchangeFileImportyApi.cs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CometServer/Modules/10-25/EngineeringModelApi.cs b/CometServer/Modules/10-25/EngineeringModelApi.cs index 2524ac0a..2d0962e1 100644 --- a/CometServer/Modules/10-25/EngineeringModelApi.cs +++ b/CometServer/Modules/10-25/EngineeringModelApi.cs @@ -882,7 +882,7 @@ private IEnumerable GetContainmentResponse(IRequestUtils requestUtils, IC /// /// If engineering model could not be resolved /// - private static EngineeringModelSetup DetermineEngineeringModelSetup(IRequestUtils requestUtils, ICdp4TransactionManager transactionManager, IProcessor processor, string[] routeSegments) + private static EngineeringModelSetup DetermineEngineeringModelSetup(IRequestUtils requestUtils, ICdp4TransactionManager transactionManager, ResourceProcessor processor, string[] routeSegments) { // override query parameters to return only extent shallow requestUtils.OverrideQueryParameters = new QueryParameters(); @@ -922,7 +922,7 @@ private static EngineeringModelSetup DetermineEngineeringModelSetup(IRequestUtil /// /// The resolved . /// - private static Iteration DetermineIteration(IProcessor processor, string partition, string[] routeSegments) + private static Iteration DetermineIteration(ResourceProcessor processor, string partition, string[] routeSegments) { if (routeSegments.Length >= 4 && routeSegments[2] == "iteration") { diff --git a/CometServer/Modules/10-25/ExchangeFileImportyApi.cs b/CometServer/Modules/10-25/ExchangeFileImportyApi.cs index edbc5cd2..e8b27255 100644 --- a/CometServer/Modules/10-25/ExchangeFileImportyApi.cs +++ b/CometServer/Modules/10-25/ExchangeFileImportyApi.cs @@ -516,13 +516,13 @@ private bool InsertModelData(IRequestUtils requestUtils, ICdp4TransactionManager // Add missing Person permissions this.CreateMissingPersonPermissions(transaction, personRoleService, personPermissionService, defaultPermissionProvider); - this.logger.LogInformation($"{seededSiteRdlCount}/{siteRdlCount} Site Reference Data Libraries and {seededEngineeringModelCount}/{engineeringModelCount} Engineering Models seeded"); + this.logger.LogInformation("{seededSiteRdlCount}/{siteRdlCount} Site Reference Data Libraries and {seededEngineeringModelCount}/{engineeringModelCount} Engineering Models seeded", seededSiteRdlCount, siteRdlCount, seededEngineeringModelCount, engineeringModelCount); var engineeringModelSetups = items.OfType() .ToList(); - var engineeringModelService = - serviceProvider.MapToPersitableService("EngineeringModel"); + var engineeringModelService = serviceProvider.MapToPersitableService("EngineeringModel"); + var iterationService = serviceProvider.MapToPersitableService("Iteration"); foreach (var engineeringModelSetup in engineeringModelSetups) @@ -538,6 +538,7 @@ private bool InsertModelData(IRequestUtils requestUtils, ICdp4TransactionManager // should return one engineeringmodel topcontainer var engineeringModel = engineeringModelItems.OfType().Single(); + if (engineeringModel == null) { this.logger.LogWarning("The EngineeringModel Thing for {shortname} could not be found, seeding will abort", engineeringModelSetup.ShortName); @@ -609,8 +610,7 @@ private bool InsertModelData(IRequestUtils requestUtils, ICdp4TransactionManager seededEngineeringModelCount++; - this.logger.LogInformation($"{seededSiteRdlCount}/{siteRdlCount} Site Reference Data Libraries and {seededEngineeringModelCount}/{engineeringModelCount} Engineering Models seeded"); - + this.logger.LogInformation("{seededSiteRdlCount}/{siteRdlCount} Site Reference Data Libraries and {seededEngineeringModelCount}/{engineeringModelCount} Engineering Models seeded", seededSiteRdlCount, siteRdlCount, seededEngineeringModelCount, engineeringModelCount); } }