feat: Pause IO for BackupProvider (#4182)

This makes the BackupProvider automatically invoke pause-io while it
is needed.

It needed to make the guard independent from the Context lifetime to
make this work.  Which is a bit sad.
This commit is contained in:
Floris Bruynooghe
2023-03-20 19:57:17 +01:00
committed by GitHub
parent e04efdbd94
commit 35f50a8965
4 changed files with 21 additions and 23 deletions

View File

@@ -91,7 +91,7 @@ pub async fn imex(
let cancel = context.alloc_ongoing().await?;
let res = {
let mut guard = context.scheduler.pause(context).await;
let mut guard = context.scheduler.pause(context.clone()).await;
let res = imex_inner(context, what, path, passphrase)
.race(async {
cancel.recv().await.ok();