Changes on messages

This commit is contained in:
2026-03-28 21:26:45 +01:00
parent 4e3302c144
commit b39de0d870
25 changed files with 153 additions and 179 deletions
@@ -1,4 +1,4 @@
using MassTransit;
using MassTransit;
using Microsoft.Extensions.Logging;
using Musify.Application.Contracts.Infrastructure;
using Musify.Domain.Entities;
@@ -48,7 +48,7 @@ namespace Musify.Infrastructure.MassTransit.Activities
if (!result.IsSuccess)
{
var errorMessage = string.Join("; ", result.Errors);
logger.LogError("Transcoding failed for file={SourceFilePath}. Errors={ErrorMessage}",
logger.LogError("Transcoding failed for {SourceFilePath}: {Errors}",
sourceFilePath, errorMessage);
throw new Exception(errorMessage);
}
@@ -60,7 +60,7 @@ namespace Musify.Infrastructure.MassTransit.Activities
}
catch (Exception exception)
{
logger.LogError(exception, "Error during transcoding activity for file={SourceFilePath}",
logger.LogError(exception, "Failed to transcode {SourceFilePath}",
sourceFilePath);
await processTrackingStore.FailStepAsync(processId, stepId, exception.Message, executeContext.CancellationToken);
throw;
@@ -74,13 +74,13 @@ namespace Musify.Infrastructure.MassTransit.Activities
if (Directory.Exists(compensateContext.Log.WorkingDirectory))
Directory.Delete(compensateContext.Log.WorkingDirectory, recursive: true);
else
logger.LogWarning("Working directory={WorkingDirectory} does not exist during compensation",
logger.LogWarning("Working directory {WorkingDirectory} not found during compensation",
compensateContext.Log.WorkingDirectory);
return Task.FromResult(compensateContext.Compensated());
}
catch (Exception exception)
{
logger.LogError(exception, "Error compensating transcoded audio directory={WorkingDirectory}", compensateContext.Log.WorkingDirectory);
logger.LogError(exception, "Failed to compensate transcoded audio directory {WorkingDirectory}", compensateContext.Log.WorkingDirectory);
return Task.FromResult(compensateContext.Failed(exception));
}
}