Skip to content

Commit

Permalink
Better form
Browse files Browse the repository at this point in the history
  • Loading branch information
johnml1135 committed Jan 15, 2025
1 parent 27ecd63 commit 8c0cfbc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ await _outboxes.UpdateAsync(
string filePath = Path.Combine(_options.CurrentValue.OutboxDir, outboxMessage.Id);
try
{
await using Stream fileStream = _fileSystem.OpenWrite(filePath);
await contentStream.CopyToAsync(fileStream, cancellationToken);
await fileStream.FlushAsync(cancellationToken);
await fileStream.DisposeAsync();
using (Stream fileStream = _fileSystem.OpenWrite(filePath))
{
await contentStream.CopyToAsync(fileStream, cancellationToken);
}
await _messages.InsertAsync(outboxMessage, cancellationToken: cancellationToken);
return outboxMessage.Id;
}
Expand Down

0 comments on commit 8c0cfbc

Please sign in to comment.