Skip to content

Commit 82b710a

Browse files
author
Ben Aaron Goldberg
committed
Flush config file to avoid losing data
For some reason not flushing the config file will sometime cause the write to not complete resulting in an empty config file. This behaviour seems like a bug, possible in async-std, and should be investigated furtherer.
1 parent a007eb4 commit 82b710a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ async fn init_file_if_not_exists(
4343

4444
if let Some(text) = text {
4545
file.write_all(text).await?;
46+
file.flush().await?;
4647
}
4748
}
4849
Ok(())

0 commit comments

Comments
 (0)