mirror of
https://github.com/chatmail/core.git
synced 2026-04-22 07:56:29 +03:00
feat: Context::set_config(): Restart IO scheduler if needed (#5111)
Restart the IO scheduler if needed to make the new config value effective (for `MvboxMove, OnlyFetchMvbox, SentboxWatch` currently). Also add `set_config_internal()` which doesn't affect running the IO scheduler. The reason is that `Scheduler::start()` itself calls `set_config()`, although not for the mentioned keys, but still, and also Rust complains about recursive async calls.
This commit is contained in:
10
src/qr.rs
10
src/qr.rs
@@ -560,8 +560,12 @@ async fn set_account_from_qr(context: &Context, qr: &str) -> Result<()> {
|
||||
"Cannot create account, response from {url_str:?} is malformed:\n{response_text:?}"
|
||||
)
|
||||
})?;
|
||||
context.set_config(Config::Addr, Some(&email)).await?;
|
||||
context.set_config(Config::MailPw, Some(&password)).await?;
|
||||
context
|
||||
.set_config_internal(Config::Addr, Some(&email))
|
||||
.await?;
|
||||
context
|
||||
.set_config_internal(Config::MailPw, Some(&password))
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
} else {
|
||||
@@ -589,7 +593,7 @@ pub async fn set_config_from_qr(context: &Context, qr: &str) -> Result<()> {
|
||||
instance_pattern,
|
||||
} => {
|
||||
context
|
||||
.set_config(Config::WebrtcInstance, Some(&instance_pattern))
|
||||
.set_config_internal(Config::WebrtcInstance, Some(&instance_pattern))
|
||||
.await?;
|
||||
}
|
||||
Qr::WithdrawVerifyContact {
|
||||
|
||||
Reference in New Issue
Block a user