mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 06:20:26 +00:00
Limit number of pushed add/delete
This commit is contained in:
parent
04eca44f11
commit
0529d4b09d
2 changed files with 15 additions and 9 deletions
|
@ -150,7 +150,7 @@ class Core {
|
|||
private static final long LOCAL_RETRY_DELAY = 5 * 1000L; // milliseconds
|
||||
private static final int TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 5;
|
||||
private static final int MAX_PREVIEW = 5000; // characters
|
||||
private static final int MAX_FETCH = 100;
|
||||
static final int MAX_FETCH = 100;
|
||||
|
||||
static void processOperations(
|
||||
Context context,
|
||||
|
|
|
@ -1166,10 +1166,13 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid);
|
||||
}
|
||||
if (e.getMessages().length > Core.MAX_FETCH)
|
||||
EntityOperation.sync(ServiceSynchronize.this, folder.id, false);
|
||||
else
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid);
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
|
@ -1195,10 +1198,13 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid, true);
|
||||
}
|
||||
if (e.getMessages().length > Core.MAX_FETCH)
|
||||
EntityOperation.sync(ServiceSynchronize.this, folder.id, false);
|
||||
else
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid, true);
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
|
|
Loading…
Reference in a new issue