Skip to content

Commit 442a90b

Browse files
Merge branch 'dev' into LNK-4651-AddHic-Type-for-AdhocReportGeneration
2 parents 8aefea6 + aa7e2f8 commit 442a90b

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

DotNet/DataAcquisition.Domain/Application/Services/PatientDataService.cs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -398,32 +398,15 @@ public async Task ExecuteLogRequest(AcquisitionRequest request, CancellationToke
398398
{
399399
var nonReferenceLogsCnt = await _dataAcquisitionLogQueries.GetCountOfNonRefLogsIncompleteAsync(
400400
log.FacilityId,
401-
log.CorrelationId,
402401
log.ReportTrackingId,
402+
log.CorrelationId,
403403
cancellationToken);
404404

405-
if (nonReferenceLogsCnt > 0 && (log.RetryAttempts ?? 0) < DataAcquisitionLog.MaxRetryAttempts)
406-
{
407-
log.Status = RequestStatus.Pending;
408-
log.RetryAttempts = (log.RetryAttempts ?? 0) + 1;
409-
await _dataAcquisitionLogManager.UpdateAsync(new UpdateDataAcquisitionLogModel
410-
{
411-
Id = log.Id,
412-
ResourceAcquiredIds = log.ResourceAcquiredIds,
413-
RetryAttempts = log.RetryAttempts,
414-
CompletionDate = log.CompletionDate,
415-
CompletionTimeMilliseconds = log.CompletionTimeMilliseconds, TraceId = log.TraceId,
416-
ExecutionDate = log.ExecutionDate,
417-
Notes = log.Notes,
418-
Status = log.Status,
419-
}, cancellationToken);
420-
return;
421-
}
422-
else if ((log.RetryAttempts ?? 0) >= DataAcquisitionLog.MaxRetryAttempts)
405+
if (nonReferenceLogsCnt > 0)
423406
{
424407
log.Notes ??= new List<string>();
425-
log.Status = RequestStatus.Failed;
426-
log.Notes.Add($"[{DateTime.UtcNow}] Log with ID {log.Id} has exceeded the maximum retry attempts. Not all Non-reference resource queries are completed. Marking as Failed.");
408+
log.Status = RequestStatus.Pending;
409+
log.Notes.Add($"[{DateTime.UtcNow}] Deferring log with ID {log.Id} due to {nonReferenceLogsCnt} incomplete non-reference log(s).");
427410
await _dataAcquisitionLogManager.UpdateAsync(new UpdateDataAcquisitionLogModel
428411
{
429412
Id = log.Id,

0 commit comments

Comments
 (0)