1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 01:06:04 +00:00

Fixed connection pool lock

This commit is contained in:
M66B 2020-08-14 09:55:51 +02:00
parent 0a1f43837a
commit 7b10c00f45
3 changed files with 9 additions and 5 deletions

View file

@ -3963,7 +3963,8 @@ public class IMAPFolder extends Folder implements UIDFolder, ResponseHandler {
protocol.noop();
}
if (keepStoreAlive && ((IMAPStore)store).hasSeparateStoreConnection()) {
if (keepStoreAlive && ((IMAPStore)store).hasSeparateStoreConnection() &&
!((IMAPStore)store).isStoreConnectionInUse()) {
IMAPProtocol p = null;
try {
p = ((IMAPStore)store).getFolderStoreProtocol();

View file

@ -1264,7 +1264,11 @@ public class IMAPStore extends Store
return pool.separateStoreConnection;
}
/**
boolean isStoreConnectionInUse() {
return pool.storeConnectionInUse;
}
/**
* Return the connection pool logger.
*/
MailLogger getConnectionPoolLogger() {

View file

@ -2286,7 +2286,6 @@ public class MessageHelper {
static int getMessageCount(Folder folder) throws MessagingException {
// Keep alive
int total = folder.getMessageCount();
try {
int count = 0;
for (Message message : folder.getMessages())
@ -2295,8 +2294,8 @@ public class MessageHelper {
return count;
} catch (Throwable ex) {
Log.w(ex);
return total;
Log.e(ex);
return -1;
}
}