Limit number of pushed add/delete

pull/187/head
M66B 4 years ago
parent 04eca44f11
commit 0529d4b09d

@ -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…
Cancel
Save