From edd0b419c76b56a8ac18b66b217b543e8a1b1eac Mon Sep 17 00:00:00 2001 From: WofWca Date: Fri, 18 Apr 2025 00:46:51 +0400 Subject: [PATCH] fix: try_many_times: retry 5 times instead of 60 If 5 times is not enough, 60 will probably not be enough either. This is mainly an attempt of improving the situation with https://github.com/deltachat/deltachat-desktop/issues/3959. The `remove_account` RPC call would make the RPC server stop responding to all other requests, which is basically equivalent to a one minute hang. Additionally, `try_many_times` appears to be unnecessary after https://github.com/chatmail/core/pull/5814#issuecomment-2257164502. --- src/accounts.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accounts.rs b/src/accounts.rs index b3a72599be..14b255e622 100644 --- a/src/accounts.rs +++ b/src/accounts.rs @@ -663,7 +663,7 @@ impl Config { } } -/// Spend up to 1 minute trying to do the operation. +/// Try the operation 5 times, waiting 1 second between retries. /// /// Even if Delta Chat itself does not hold the file lock, /// there may be other processes such as antivirus, @@ -681,7 +681,7 @@ where counter += 1; if let Err(err) = f().await { - if counter > 60 { + if counter >= 5 { return Err(err); }