diff options
author | Vika <vika@fireburn.ru> | 2022-07-14 05:46:42 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2022-07-14 05:46:42 +0300 |
commit | 2c509e85429c70b528a73d7a57a3c080fb8b06bf (patch) | |
tree | c6fea95434cd0cec50017a246dc384362439cf3c /kittybox-rs/src/media/storage/mod.rs | |
parent | d8556f4eb27412f60fa48b73b18db0e52d388409 (diff) | |
download | kittybox-2c509e85429c70b528a73d7a57a3c080fb8b06bf.tar.zst |
media: buffer disk I/O and add debug logging
It looks like buffering reads can double my performance. Nice.
Diffstat (limited to 'kittybox-rs/src/media/storage/mod.rs')
-rw-r--r-- | kittybox-rs/src/media/storage/mod.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kittybox-rs/src/media/storage/mod.rs b/kittybox-rs/src/media/storage/mod.rs index cb8b38f..5614437 100644 --- a/kittybox-rs/src/media/storage/mod.rs +++ b/kittybox-rs/src/media/storage/mod.rs @@ -4,6 +4,7 @@ use tokio_stream::Stream; use bytes::Bytes; use serde::{Deserialize, Serialize}; use std::pin::Pin; +use std::fmt::Debug; pub mod file; @@ -86,7 +87,7 @@ pub trait MediaStore: 'static + Send + Sync + Clone { content: T, ) -> Result<String> where - T: tokio_stream::Stream<Item = std::result::Result<bytes::Bytes, axum::extract::multipart::MultipartError>> + Unpin + Send; + T: tokio_stream::Stream<Item = std::result::Result<bytes::Bytes, axum::extract::multipart::MultipartError>> + Unpin + Send + Debug; async fn read_streaming( &self, |