mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-11-17 00:07:53 +00:00
use BufWritter to save the cache
This commit is contained in:
parent
65378b0523
commit
d0bd17c560
2 changed files with 5 additions and 2 deletions
|
@ -1,7 +1,9 @@
|
|||
use std::io::Write;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
collections::HashSet,
|
||||
fmt::{Display, Formatter},
|
||||
io::BufWriter,
|
||||
path::Path,
|
||||
sync::Arc,
|
||||
};
|
||||
|
@ -35,8 +37,9 @@ impl ScanningCache {
|
|||
.truncate(true)
|
||||
.create(true)
|
||||
.open(file)?;
|
||||
let mut writer = file.make_writer();
|
||||
let mut writer = BufWriter::new(file.make_writer());
|
||||
bincode::encode_into_std_write(self, &mut writer, bincode::config::standard())?;
|
||||
writer.flush()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ use std::{
|
|||
use futures::{
|
||||
channel::mpsc::{self, SendError},
|
||||
stream::FuturesUnordered,
|
||||
SinkExt,
|
||||
SinkExt, StreamExt,
|
||||
};
|
||||
use monero_serai::rpc::HttpRpc;
|
||||
use tokio::time::timeout;
|
||||
|
|
Loading…
Reference in a new issue