Skip to content

Commit

Permalink
no pretranslations written (#602)
Browse files Browse the repository at this point in the history
* Fix for #601 - no pretranslations written

* Better form

* await using
  • Loading branch information
johnml1135 authored Jan 15, 2025
1 parent a4203cf commit ac6f0b2
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ await _outboxes.UpdateAsync(
Content = serializedContent,
HasContentStream = false
};
string filePath = Path.Combine(_options.CurrentValue.OutboxDir, outboxMessage.Id);
await _messages.InsertAsync(outboxMessage, cancellationToken: cancellationToken);
return outboxMessage.Id;
}
Expand Down Expand Up @@ -85,8 +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 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 ac6f0b2

Please sign in to comment.