dont blow up memory
This commit is contained in:
parent
e9617e7f80
commit
3769cae1ce
1 changed files with 7 additions and 4 deletions
|
|
@ -262,11 +262,14 @@ impl TorrentStateLive {
|
||||||
if defer_writes {
|
if defer_writes {
|
||||||
state.spawn(
|
state.spawn(
|
||||||
error_span!(parent: state.meta.span.clone(), "disk_writer"),
|
error_span!(parent: state.meta.span.clone(), "disk_writer"),
|
||||||
async move {
|
{
|
||||||
while let Some(work_item) = disk_work_rx.recv().await {
|
let spawner = state.meta.spawner;
|
||||||
tokio::task::spawn_blocking(work_item.work);
|
async move {
|
||||||
|
while let Some(work_item) = disk_work_rx.recv().await {
|
||||||
|
spawner.spawn_block_in_place(work_item.work);
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
Ok(())
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue