From f10c89dbeaca164f560657b82d0d7395d7379992 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 3 Apr 2022 20:46:23 +0200 Subject: [PATCH] Revert "Skip stopped orphan threads" This reverts commit 5c58d3e314259f8ba4e61c257fa69c71ed152631. --- .../main/java/eu/faircode/email/ServiceSynchronize.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 554e1a53da..29015862f5 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1388,7 +1388,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences state.setBackoff(CONNECT_BACKOFF_START); if (account.backoff_until != null) db.account().setAccountBackoff(account.id, null); - while (state.isRunning()) { + while (state.isRunning() && currentThread.equals(accountThread)) { state.reset(); Log.i(account.name + " run thread=" + currentThread); @@ -2476,11 +2476,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences accountThread = db.account().getAccountThread(account.id); } - if (!currentThread.equals(accountThread) && accountThread != null) { - String msg = account.name + " orphan thread id=" + currentThread + "/" + accountThread; - EntityLog.log(this, msg); - Log.e(msg); - } + if (!currentThread.equals(accountThread) && accountThread != null) + Log.e(account.name + " orphan thread id=" + currentThread + "/" + accountThread); } finally { EntityLog.log(this, EntityLog.Type.Account, account, account.name + " stopped running=" + state.isRunning());