Skip to content

Commit

Permalink
additional logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Dec 24, 2024
1 parent 4bb397a commit 718c05e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/backend/api/Services/DocumentQueueService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ public PimsDocumentQueue GetById(long documentQueueId)
/// <exception cref="UnauthorizedAccessException">Thrown when the user is not authorized to perform this operation.</exception>
public IEnumerable<PimsDocumentQueue> SearchDocumentQueue(DocumentQueueFilter filter)
{
this.Logger.LogInformation("Retrieving queued PIMS documents using filter {filter}", filter);
this.Logger.LogInformation("Retrieving queued PIMS documents using filter {filter}", filter.Serialize());
this.User.ThrowIfNotAuthorizedOrServiceAccount(Permissions.SystemAdmin, this._keycloakOptions);

var queuedDocuments = _documentQueueRepository.GetAllByFilter(filter);

if (filter.MaxFileSize != null) {
if (filter.MaxFileSize != null)
{
List<PimsDocumentQueue> documentsBelowMaxFileSize = new List<PimsDocumentQueue>();
long totalFileSize = 0;
queuedDocuments.ForEach(currentDocument =>
Expand All @@ -104,6 +105,7 @@ public IEnumerable<PimsDocumentQueue> SearchDocumentQueue(DocumentQueueFilter fi
{
documentsBelowMaxFileSize.Add(queuedDocuments.FirstOrDefault());
}
this.Logger.LogDebug("returning {length} documents below file size", documentsBelowMaxFileSize.Count);
return documentsBelowMaxFileSize;
}
return queuedDocuments;
Expand Down

0 comments on commit 718c05e

Please sign in to comment.