From 8e76d93f7a0e566a6b52e7d47110a34aca6ce6e8 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 23 Nov 2020 09:35:17 +0100 Subject: [PATCH] Increased connection pool timeout to 60 seconds --- app/src/main/java/eu/faircode/email/EmailService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EmailService.java b/app/src/main/java/eu/faircode/email/EmailService.java index 7074f091b3..9a88167fae 100644 --- a/app/src/main/java/eu/faircode/email/EmailService.java +++ b/app/src/main/java/eu/faircode/email/EmailService.java @@ -130,7 +130,8 @@ public class EmailService implements AutoCloseable { private final static int SEARCH_TIMEOUT = 90 * 1000; // milliseconds private final static int FETCH_SIZE = 1024 * 1024; // bytes, default 16K - private final static int POOL_TIMEOUT = 45 * 1000; // milliseconds, default 45 sec + private final static int POOL_SIZE = 2; // connections + private final static int POOL_TIMEOUT = 60 * 1000; // milliseconds, default 45 sec private final static int TCP_KEEP_ALIVE_INTERVAL = 9 * 60; // seconds @@ -232,7 +233,7 @@ public class EmailService implements AutoCloseable { properties.put("mail." + protocol + ".separatestoreconnection", "true"); properties.put("mail." + protocol + ".connectionpool.debug", "true"); - properties.put("mail." + protocol + ".connectionpoolsize", Integer.toString(2)); + properties.put("mail." + protocol + ".connectionpoolsize", Integer.toString(POOL_SIZE)); properties.put("mail." + protocol + ".connectionpooltimeout", Integer.toString(POOL_TIMEOUT)); properties.put("mail." + protocol + ".finalizecleanclose", "false");