src/client/remote_chunk_reader.rs: use tokio::task::block_in_place to avoid blocking

Else we block the current executor.
This commit is contained in:
Dietmar Maurer 2020-01-16 13:52:23 +01:00
parent dbd3e5da12
commit 625d19621f

View File

@ -35,7 +35,7 @@ impl ReadChunk for RemoteChunkReader {
let mut chunk_data = Vec::with_capacity(4*1024*1024);
futures::executor::block_on(self.client.download_chunk(&digest, &mut chunk_data))?;
tokio::task::block_in_place(|| futures::executor::block_on(self.client.download_chunk(&digest, &mut chunk_data)))?;
let chunk = DataBlob::from_raw(chunk_data)?;
chunk.verify_crc()?;