Update delete workflows
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
using MassTransit;
|
||||
using Amazon.S3;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Musify.Application.Abstractions.Infrastructure;
|
||||
using Musify.Infrastructure.MassTransit.Activities.Arguments;
|
||||
using System.Net;
|
||||
|
||||
namespace Musify.Infrastructure.MassTransit.Activities.Files
|
||||
{
|
||||
@@ -22,6 +24,16 @@ namespace Musify.Infrastructure.MassTransit.Activities.Files
|
||||
executeContext.CancellationToken);
|
||||
return executeContext.Completed();
|
||||
}
|
||||
catch (AmazonS3Exception exception) when (
|
||||
exception.StatusCode == HttpStatusCode.NotFound
|
||||
|| string.Equals(exception.ErrorCode, "NoSuchKey", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
logger.LogInformation(
|
||||
"Key {Key} not found in bucket {Bucket}, skipping",
|
||||
executeContext.Arguments.Key,
|
||||
executeContext.Arguments.Bucket);
|
||||
return executeContext.Completed();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
logger.LogError(exception, "Failed to remove {Key} from bucket {Bucket}",
|
||||
|
||||
Reference in New Issue
Block a user