1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Retry finding cross account moved message

This commit is contained in:
M66B 2021-03-11 10:21:17 +01:00
parent c3e6d15bb6
commit 670a5d8b20

View file

@ -155,6 +155,8 @@ class Core {
private static final int TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 5;
private static final int MAX_PREVIEW = 5000; // characters
private static final long EXISTS_RETRY_DELAY = 20 * 1000L; // milliseconds
private static final int FIND_RETRY_COUNT = 3; // times
private static final long FIND_RETRY_DELAY = 5 * 1000L; // milliseconds
static void processOperations(
Context context,
@ -1026,7 +1028,17 @@ class Core {
}
} else {
// Lookup added messages
Long found = findUid(context, ifolder, message.msgid, false);
int count = 0;
Long found = null;
while (found == null && count++ < FIND_RETRY_COUNT) {
found = findUid(context, ifolder, message.msgid, false);
if (found == null)
try {
Thread.sleep(FIND_RETRY_DELAY);
} catch (InterruptedException ex) {
Log.e(ex);
}
}
try {
db.beginTransaction();