Skip to content

Commit

Permalink
Couple of updates after reviewing PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Anderson committed Dec 6, 2024
1 parent 0051577 commit 39a1c08
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions Btms.Business/Services/LinkingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ await dbContext.Notifications.Update(notification, notification._Etag, transacti
}
catch (Exception e)
{
// No Exception is logged at this point, as its logged further up the stack
metrics.Faulted(e);
throw new LinkException(e);
}
Expand Down
4 changes: 2 additions & 2 deletions Btms.Consumers/AlvsClearanceRequestConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ public async Task OnHandle(AlvsClearanceRequest message)

if (existingMovement is not null)
{
persistedMovement = existingMovement.DeepClone();
if (movement.ClearanceRequests[0].Header?.EntryVersionNumber >
existingMovement.ClearanceRequests[0].Header?.EntryVersionNumber)
{
////movement.AuditEntries = existingMovement.AuditEntries;
persistedMovement = existingMovement.DeepClone();
var auditEntry = AuditEntry.CreateUpdated(existingMovement.ClearanceRequests[0],
movement.ClearanceRequests[0],
BuildNormalizedAlvsPath(auditId!),
Expand All @@ -68,6 +67,7 @@ public async Task OnHandle(AlvsClearanceRequest message)
{
logger.MessageSkipped(Context.GetJobId()!, auditId!, GetType().Name, message.Header?.EntryReference!);
Context.Skipped();
return;
}
}
else
Expand Down
3 changes: 2 additions & 1 deletion Btms.Consumers/NotificationConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public async Task OnHandle(ImportNotification message)
Model.Ipaffs.ImportNotification persistedNotification = null!;
if (existingNotification is not null)
{
persistedNotification = existingNotification.DeepClone();
if (internalNotification.UpdatedSource.TrimMicroseconds() >
existingNotification.UpdatedSource.TrimMicroseconds())
{
persistedNotification = existingNotification.DeepClone();
internalNotification.AuditEntries = existingNotification.AuditEntries;
internalNotification.CreatedSource = existingNotification.CreatedSource;
internalNotification.Update(BuildNormalizedIpaffsPath(auditId!), existingNotification);
Expand All @@ -51,6 +51,7 @@ public async Task OnHandle(ImportNotification message)
{
logger.MessageSkipped(Context.GetJobId()!, auditId!, GetType().Name, message.ReferenceNumber!);
Context.Skipped();
return;
}
}
else
Expand Down

0 comments on commit 39a1c08

Please sign in to comment.