Skip to content

Commit

Permalink
[SQ - Improvements] logging and use of concrete class over interface …
Browse files Browse the repository at this point in the history
…for performance improvement
  • Loading branch information
samatrhea committed Dec 24, 2023
1 parent 23b12e8 commit ba4f995
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CometServer/Modules/10-25/EngineeringModelApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ private IEnumerable<Thing> GetContainmentResponse(IRequestUtils requestUtils, IC
/// <exception cref="Exception">
/// If engineering model could not be resolved
/// </exception>
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();
Expand Down Expand Up @@ -922,7 +922,7 @@ private static EngineeringModelSetup DetermineEngineeringModelSetup(IRequestUtil
/// <returns>
/// The resolved <see cref="Iteration"/>.
/// </returns>
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")
{
Expand Down
10 changes: 5 additions & 5 deletions CometServer/Modules/10-25/ExchangeFileImportyApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<EngineeringModelSetup>()
.ToList();
var engineeringModelService =
serviceProvider.MapToPersitableService<EngineeringModelService>("EngineeringModel");
var engineeringModelService = serviceProvider.MapToPersitableService<EngineeringModelService>("EngineeringModel");

var iterationService = serviceProvider.MapToPersitableService<IterationService>("Iteration");

foreach (var engineeringModelSetup in engineeringModelSetups)
Expand All @@ -538,6 +538,7 @@ private bool InsertModelData(IRequestUtils requestUtils, ICdp4TransactionManager

// should return one engineeringmodel topcontainer
var engineeringModel = engineeringModelItems.OfType<EngineeringModel>().Single();

if (engineeringModel == null)
{
this.logger.LogWarning("The EngineeringModel Thing for {shortname} could not be found, seeding will abort", engineeringModelSetup.ShortName);
Expand Down Expand Up @@ -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);
}
}

Expand Down

0 comments on commit ba4f995

Please sign in to comment.