From b480cff07947ca9f801d1f4c8d2564ece52265bf Mon Sep 17 00:00:00 2001 From: MrBounty Date: Wed, 12 Feb 2025 14:36:02 +0100 Subject: [PATCH] Fix I wasn't flushing writter buffer if the limit is reached as I return early --- src/file/read.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file/read.zig b/src/file/read.zig index 4afddc4..f749e57 100644 --- a/src/file/read.zig +++ b/src/file/read.zig @@ -271,6 +271,7 @@ fn parseEntitiesOneFile( const allocator = fa.allocator(); var buffered_writer = std.io.bufferedWriter(writer); + defer buffered_writer.flush() catch {}; const path = std.fmt.bufPrint(&path_buffer, "{d}.zid", .{file_index}) catch return; var iter = zid.DataIterator.init(allocator, path, dir, zid_schema) catch return; @@ -288,7 +289,6 @@ fn parseEntitiesOneFile( if (sync_context.incrementAndCheckStructLimit()) return; } - buffered_writer.flush() catch return; } // Receive a map of UUID -> empty JsonString