src/api2/reader.rs: use std::fs::read instead of tokio::fs::read
Because it is about 10%& faster this way.
This commit is contained in:
parent
5d7449a121
commit
a83e2ffeab
@ -229,8 +229,7 @@ fn download_chunk(
|
|||||||
|
|
||||||
env.debug(format!("download chunk {:?}", path));
|
env.debug(format!("download chunk {:?}", path));
|
||||||
|
|
||||||
let data = tokio::fs::read(path)
|
let data = tools::runtime::block_in_place(|| std::fs::read(path))
|
||||||
.await
|
|
||||||
.map_err(move |err| http_err!(BAD_REQUEST, "reading file {:?} failed: {}", path2, err))?;
|
.map_err(move |err| http_err!(BAD_REQUEST, "reading file {:?} failed: {}", path2, err))?;
|
||||||
|
|
||||||
let body = Body::from(data);
|
let body = Body::from(data);
|
||||||
|
Loading…
Reference in New Issue
Block a user