Changes on packages
This commit is contained in:
@@ -16,7 +16,7 @@ namespace Musify.Infrastructure.Services
|
||||
if (duration <= TimeSpan.Zero)
|
||||
return await factory();
|
||||
|
||||
if (cache.TryGetValue(key, out TValue? cached) && cached is not null)
|
||||
if (cache.TryGetValue(key, out TValue? cached) && cached != null)
|
||||
return cached;
|
||||
|
||||
var pending = (Lazy<Task<ErrorOr<TValue>>>)inFlight.GetOrAdd(
|
||||
|
||||
@@ -276,7 +276,7 @@ namespace Musify.Infrastructure.Services
|
||||
{
|
||||
listResponse = await amazonS3.ListObjectsV2Async(listRequest, cancellationToken);
|
||||
|
||||
if (listResponse.S3Objects is null or { Count: 0 } )
|
||||
if (listResponse.S3Objects == null|| listResponse.S3Objects.Count == 0)
|
||||
break;
|
||||
|
||||
var deleteRequest = new DeleteObjectsRequest
|
||||
@@ -289,9 +289,6 @@ namespace Musify.Infrastructure.Services
|
||||
|
||||
var deleteResponse = await amazonS3.DeleteObjectsAsync(deleteRequest, cancellationToken);
|
||||
|
||||
// Some S3-compatible backends (SeaweedFS included) omit the <Error> list from the
|
||||
// XML response entirely when nothing failed, which the SDK deserializes as null
|
||||
// rather than an empty list — real AWS S3 always returns a (possibly empty) list.
|
||||
var deleteErrors = deleteResponse.DeleteErrors ?? [];
|
||||
if (deleteErrors.Count > 0)
|
||||
{
|
||||
|
||||
@@ -29,9 +29,9 @@ namespace Musify.Infrastructure.Services
|
||||
var now = DateTimeOffset.UtcNow;
|
||||
|
||||
var claims = new Dictionary<string, object> { ["prefix"] = keyPrefix };
|
||||
if (userId is not null)
|
||||
if (userId != null)
|
||||
claims["sub"] = userId.Value.ToString();
|
||||
if (maxBytes is not null)
|
||||
if (maxBytes != null)
|
||||
claims["maxBytes"] = maxBytes.Value.ToString();
|
||||
|
||||
var descriptor = new SecurityTokenDescriptor
|
||||
|
||||
Reference in New Issue
Block a user