Prevent failed to create new store connection exception

This commit is contained in:
M66B
2018-08-28 14:14:25 +00:00
parent 1e537c2235
commit bef7645705
2 changed files with 4 additions and 1 deletions

View File

@@ -469,6 +469,7 @@ public class ServiceSynchronize extends LifecycleService {
db.folder().setFolderState(folder.id, null);
db.account().setAccountState(account.id, "connecting");
istore.connect(account.host, account.port, account.user, account.password);
boolean hasIdle = istore.hasCapability("IDLE");
backoff = CONNECT_BACKOFF_START;
db.account().setAccountState(account.id, "connected");
@@ -627,7 +628,7 @@ public class ServiceSynchronize extends LifecycleService {
noops.add(noop);
// Receive folder events
if (istore.hasCapability("IDLE")) {
if (hasIdle) {
Thread idle = new Thread(new Runnable() {
@Override
public void run() {