Use variables

This commit is contained in:
2026-03-23 16:28:02 +01:00
parent 773a4e727c
commit 0b471db6aa
8 changed files with 35 additions and 28 deletions
@@ -30,10 +30,16 @@ namespace Musify.Infrastructure.Messaging.Activities
0,
executeContext.CancellationToken);
var folderPath = executeContext.GetVariable<string>("WorkingDirectory");
if (string.IsNullOrWhiteSpace(folderPath))
{
throw new InvalidOperationException("Transfer activity requires WorkingDirectory variable.");
}
try
{
var transferFilesResult = await storageHandler.TransferFilesAsync(
executeContext.Arguments.FolderPath,
folderPath,
executeContext.Arguments.DestinationBucketName,
executeContext.Arguments.DestinationKeyName,
executeContext.CancellationToken);
@@ -42,7 +48,7 @@ namespace Musify.Infrastructure.Messaging.Activities
{
var errorMessage = string.Join("; ", transferFilesResult.Errors);
logger.LogError("Failed to transfer files from {FolderPath} to bucket {DestinationBucketName}, key {DestinationKeyName}. Errors: {Errors}",
executeContext.Arguments.FolderPath,
folderPath,
executeContext.Arguments.DestinationBucketName,
executeContext.Arguments.DestinationKeyName,
errorMessage);
@@ -55,7 +61,7 @@ namespace Musify.Infrastructure.Messaging.Activities
catch (Exception exception)
{
logger.LogError(exception, "Error transferring files from {FolderPath} to bucket {DestinationBucketName}",
executeContext.Arguments.FolderPath,
folderPath,
executeContext.Arguments.DestinationBucketName);
await processTrackingStore.FailStepAsync(processId, stepId, exception.Message, executeContext.CancellationToken);
throw;