Revert "Replace fetches by sync"

This reverts commit e371eb9948.
This commit is contained in:
M66B 2020-11-06 07:49:56 +01:00
parent e82b7b6725
commit 155f88abd0
1 changed files with 0 additions and 23 deletions

View File

@ -150,7 +150,6 @@ class Core {
private static final long LOCAL_RETRY_DELAY = 5 * 1000L; // milliseconds 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 TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 5;
private static final int MAX_PREVIEW = 5000; // characters private static final int MAX_PREVIEW = 5000; // characters
private static final int MAX_FETCH = 100;
static void processOperations( static void processOperations(
Context context, Context context,
@ -163,28 +162,6 @@ class Core {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
// Replace fetches by sync
List<EntityOperation> fetches = new ArrayList<>();
for (EntityOperation op : ops)
if (EntityOperation.FETCH.equals(op.name))
fetches.add(op);
if (fetches.size() > MAX_FETCH) {
EntityLog.log(context, "Replacing fetches=" + fetches.size() + " by sync");
try {
db.beginTransaction();
for (EntityOperation op : fetches) {
db.operation().deleteOperation(op.id);
ops.remove(op);
}
EntityOperation.sync(context, folder.id, false);
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}
int retry = 0; int retry = 0;
boolean group = true; boolean group = true;
Log.i(folder.name + " executing operations=" + ops.size()); Log.i(folder.name + " executing operations=" + ops.size());