Skip to content

Commit 2fed93c

Browse files
committed
Fix benchmark loop
1 parent 7a2edd2 commit 2fed93c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/benchmarks/storage.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ impl StorageBenchmark {
2222
.create(true)
2323
.write(true)
2424
.open(&self.path)?;
25-
while true {
25+
while remaining_size > 0 {
2626
let chunk_size = min(self.chunk_size, remaining_size);
2727
let _written = file.write(&buf[..chunk_size])?;
2828
// Notice: somehow there's a bug or what making written size returning 0, which is
2929
// obviously wrong. Before we fix that, we just calculate the remaining_size
3030
// based on the size we have written
3131
remaining_size -= chunk_size;
3232
}
33-
file.sync_all();
33+
file.sync_all()?;
3434
let end = SystemTime::now();
3535
let duration = end.duration_since(start)?;
3636
log::info!(

0 commit comments

Comments
 (0)