Use variable

This commit is contained in:
2026-03-26 19:59:44 +01:00
parent 606fa26c3f
commit 7ffd63ed9a
2 changed files with 6 additions and 2 deletions
@@ -30,9 +30,13 @@ namespace Musify.Infrastructure.MassTransit.Activities.Files
0,
executeContext.CancellationToken);
var sourceFilePath = executeContext.GetVariable<string>(executeContext.Arguments.FilePathVariableName);
if (string.IsNullOrEmpty(sourceFilePath))
throw new InvalidOperationException($"Upload activity requires variable '{executeContext.Arguments.FilePathVariableName}' with source file path.");
try
{
using var fileStream = File.OpenRead(executeContext.Arguments.SourceFilePath);
using var fileStream = File.OpenRead(sourceFilePath);
var uploadResult = await storageHandler.UploadFileAsync(
fileStream,
@@ -1,7 +1,7 @@
namespace Musify.Infrastructure.MassTransit.Arguments
{
public record UploadFileToBucketArguments(
string SourceFilePath,
string FilePathVariableName,
string ContentType,
string DestinationBucketName,
string DestinationKeyName);