From 89f1321a0abd2855c14f80e5a45dabe941465de4 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 8 Sep 2018 18:15:23 +0000 Subject: [PATCH] Uses network timeout for store close timeout --- app/src/main/java/eu/faircode/email/MessageHelper.java | 2 +- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 7a202e4e..554d0246 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -61,7 +61,7 @@ public class MessageHelper { private MimeMessage imessage; private String raw = null; - private final static int NETWORK_TIMEOUT = 60 * 1000; // milliseconds + final static int NETWORK_TIMEOUT = 60 * 1000; // milliseconds static Properties getSessionProperties(Context context, int auth_type) { Properties props = new Properties(); diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 0b98b4f4..54e6ea55 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -126,7 +126,6 @@ public class ServiceSynchronize extends LifecycleService { private static final int CONNECT_BACKOFF_START = 8; // seconds private static final int CONNECT_BACKOFF_MAX = 1024; // seconds (1024 sec ~ 17 min) private static final long STORE_NOOP_INTERVAL = 9 * 60 * 1000L; // ms - private static final long STORE_CLOSE_TIMEOUT = 20 * 1000L; // ms private static final int ATTACHMENT_AUTO_DOWNLOAD_SIZE = 32 * 1024; // bytes static final String ACTION_SYNCHRONIZE_FOLDER = BuildConfig.APPLICATION_ID + ".SYNCHRONIZE_FOLDER"; @@ -807,7 +806,7 @@ public class ServiceSynchronize extends LifecycleService { }); t.start(); try { - t.join(STORE_CLOSE_TIMEOUT); + t.join(MessageHelper.NETWORK_TIMEOUT); if (t.isAlive()) Log.w(Helper.TAG, account.name + " Close timeout"); } catch (InterruptedException ex) {