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:
parent
0a1f43837a
commit
7b10c00f45
3 changed files with 9 additions and 5 deletions
|
@ -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();
|
||||
|
|
|
@ -1264,7 +1264,11 @@ public class IMAPStore extends Store
|
|||
return pool.separateStoreConnection;
|
||||
}
|
||||
|
||||
/**
|
||||
boolean isStoreConnectionInUse() {
|
||||
return pool.storeConnectionInUse;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the connection pool logger.
|
||||
*/
|
||||
MailLogger getConnectionPoolLogger() {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue