mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
fix(imex): transfer::get_backup must always free ongoing process (#4249)
* fix(imex): transfer::get_backup must always free ongoing process When the ongoing process is cancelled it is still the responsibility of whoever took out the ongoing process to free it. This code was only freeing the ongoing process when completed normally but not when cancelled. * add changelog
This commit is contained in:
committed by
GitHub
parent
d6fdc7cb67
commit
ef63e01632
@@ -392,12 +392,10 @@ pub async fn get_backup(context: &Context, qr: Qr) -> Result<()> {
|
||||
let cancel_token = context.alloc_ongoing().await?;
|
||||
let res = tokio::select! {
|
||||
biased;
|
||||
res = get_backup_inner(context, qr) => {
|
||||
context.free_ongoing().await;
|
||||
res
|
||||
}
|
||||
res = get_backup_inner(context, qr) => res,
|
||||
_ = cancel_token.recv() => Err(format_err!("cancelled")),
|
||||
};
|
||||
context.free_ongoing().await;
|
||||
res
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user