Skip to content

Commit 7a2edd2

Browse files
committed
Fix using written size bug
1 parent f8168ae commit 7a2edd2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/benchmarks/storage.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ impl StorageBenchmark {
2424
.open(&self.path)?;
2525
while true {
2626
let chunk_size = min(self.chunk_size, remaining_size);
27-
let written = file.write(&buf[..chunk_size])?;
28-
remaining_size -= written;
27+
let _written = file.write(&buf[..chunk_size])?;
28+
// Notice: somehow there's a bug or what making written size returning 0, which is
29+
// obviously wrong. Before we fix that, we just calculate the remaining_size
30+
// based on the size we have written
31+
remaining_size -= chunk_size;
2932
}
3033
file.sync_all();
3134
let end = SystemTime::now();

0 commit comments

Comments
 (0)