Skip stopped orphan threads

pull/207/head
M66B 3 years ago
parent 26dd10828f
commit 5c58d3e314

@ -1366,7 +1366,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
state.setBackoff(CONNECT_BACKOFF_START); state.setBackoff(CONNECT_BACKOFF_START);
if (account.backoff_until != null) if (account.backoff_until != null)
db.account().setAccountBackoff(account.id, null); db.account().setAccountBackoff(account.id, null);
while (state.isRunning() && currentThread.equals(accountThread)) { while (state.isRunning()) {
state.reset(); state.reset();
Log.i(account.name + " run thread=" + currentThread); Log.i(account.name + " run thread=" + currentThread);
@ -2454,8 +2454,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
accountThread = db.account().getAccountThread(account.id); accountThread = db.account().getAccountThread(account.id);
} }
if (!currentThread.equals(accountThread) && accountThread != null) if (!currentThread.equals(accountThread) && accountThread != null) {
Log.e(account.name + " orphan thread id=" + currentThread + "/" + accountThread); String msg = account.name + " orphan thread id=" + currentThread + "/" + accountThread;
EntityLog.log(this, msg);
Log.e(msg);
}
} finally { } finally {
EntityLog.log(this, EntityLog.Type.Account, account, EntityLog.log(this, EntityLog.Type.Account, account,
account.name + " stopped running=" + state.isRunning()); account.name + " stopped running=" + state.isRunning());

Loading…
Cancel
Save