Skip to content

Commit

Permalink
refactor: Embed object storage improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aneojgurhem committed Dec 16, 2024
1 parent 5b1ddc5 commit d6e75c7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Adaptors/Embed/src/ObjectStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -67,18 +67,17 @@ public Task<HealthCheckResult> Check(HealthCheckTag tag)
await foreach (var val in valueChunks.WithCancellation(cancellationToken)
.ConfigureAwait(false))
{
array.AddRange(val.ToArray());
array.AddRange(val.Span);
}

return (array.ToArray(), array.Count);
}

/// <inheritdoc />
public async IAsyncEnumerable<byte[]> GetValuesAsync(byte[] id,
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
yield return id;
}
public IAsyncEnumerable<byte[]> GetValuesAsync(byte[] id,
CancellationToken cancellationToken = default)
=> AsyncEnumerable.Repeat(id,
1);

/// <inheritdoc />
public Task TryDeleteAsync(IEnumerable<byte[]> ids,
Expand Down

0 comments on commit d6e75c7

Please sign in to comment.