mimeparser: wrap try_decrypt() into block_in_place()

try_decrypt() is a CPU-bound task.
When called from async function,
it should be wrapped in tokio::task::spawn_blocking().
Using tokio::task::spawn_blocking() is difficult here
because of &mail, &private_keyring and &public_keyring borrows,
so we should at least use tokio::task::block_in_place()
to avoid blocking the executor.
This commit is contained in:
link2xt
2023-02-21 20:51:38 +00:00
parent 1450bf5483
commit 992a6cbfc2
2 changed files with 21 additions and 19 deletions

View File

@@ -6,6 +6,7 @@
- Make smeared timestamp generation non-async. #4075
### Fixes
- Do not block async task executor while decrypting the messages. #4079
### API-Changes