Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public AzureBlobOperationDocumentStorage(BlobContainerClient client)
buffer = newBuffer;
}

var read = await blobStream.ReadAsync(buffer, position, 256, ct);
var read = await blobStream.ReadAsync(buffer.AsMemory(position, 256), ct);
position += read;

if (read < 256)
if (read == 0)
{
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public FileSystemOperationDocumentStorage(IOperationDocumentFileMap documentMap)
const int chunkSize = 4096;
await using var stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
using var writer = new PooledArrayWriter();
var read = 0;
int read;

do
{
var memory = writer.GetMemory(chunkSize);
read = await stream.ReadAsync(memory, cancellationToken).ConfigureAwait(false);
writer.Advance(read);
} while (read == chunkSize);
} while (read != 0);

var document = Utf8GraphQLParser.Parse(writer.WrittenSpan);
return new OperationDocument(document);
Expand Down
Loading