From 27ecd634d372ea5ee0c5edd4c631c073764fb33d Mon Sep 17 00:00:00 2001 From: John Lambert Date: Wed, 15 Jan 2025 10:47:50 -0500 Subject: [PATCH] Fix for #601 - no pretranslations written --- .../src/Serval.Machine.Shared/Services/MessageOutboxService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Machine/src/Serval.Machine.Shared/Services/MessageOutboxService.cs b/src/Machine/src/Serval.Machine.Shared/Services/MessageOutboxService.cs index bcde1e98..6a6e2407 100644 --- a/src/Machine/src/Serval.Machine.Shared/Services/MessageOutboxService.cs +++ b/src/Machine/src/Serval.Machine.Shared/Services/MessageOutboxService.cs @@ -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; } @@ -87,6 +86,8 @@ await _outboxes.UpdateAsync( { await using Stream fileStream = _fileSystem.OpenWrite(filePath); await contentStream.CopyToAsync(fileStream, cancellationToken); + await fileStream.FlushAsync(cancellationToken); + await fileStream.DisposeAsync(); await _messages.InsertAsync(outboxMessage, cancellationToken: cancellationToken); return outboxMessage.Id; }