Skip to content

Commit

Permalink
add additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
JackLewis-digirati committed Jan 14, 2025
1 parent de10c7f commit 8426672
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,27 @@ await dlcsOrchestratorClient.RetrieveAssetsForManifest(batch.CustomerId, batches
itemDictionary = generatedManifest.Items.Select(i =>
new KeyValuePair<AssetId, Canvas>(
AssetId.FromString(i.Id!.Remove(i.Id.IndexOf("/canvas", StringComparison.Ordinal))
.Remove(0, $"{dlcsSettings.OrchestratorUri!.ToString()}/iii-img/".Length + 1)), i))
.Remove(0, $"{dlcsSettings.OrchestratorUri!.ToString()}/iiif-img/".Length)), i))
.ToDictionary();
}
catch (Exception e)
{
logger.LogError(e, "Error retrieving the canvas id from an item in {ManifestId}", generatedManifest?.Id);
logger.LogError(e, "Error retrieving the asset id from an item in {ManifestId}", generatedManifest?.Id);
throw;
}

UpdateCanvasPaintings(generatedManifest, batch, itemDictionary!);
CompleteBatch(batch, batchCompletionMessage.Finished);
await UpdateManifestInS3(generatedManifest.Thumbnail, itemDictionary, batch, cancellationToken);
try
{
UpdateCanvasPaintings(generatedManifest, batch, itemDictionary);
CompleteBatch(batch, batchCompletionMessage.Finished);
await UpdateManifestInS3(generatedManifest.Thumbnail, itemDictionary, batch, cancellationToken);
}
catch (Exception e)
{
logger.LogError(e, "Error updating completing batch {BatchId} for manifest {ManifestId}", batch.Id,
generatedManifest.Id);
throw;
}
}

await dbContext.SaveChangesAsync(cancellationToken);
Expand Down

0 comments on commit 8426672

Please sign in to comment.