Added logging

This commit is contained in:
M66B 2021-09-15 07:15:51 +02:00
parent 7c4f6b5803
commit 8c7bbd77e1
3 changed files with 21 additions and 2 deletions

View File

@ -190,7 +190,7 @@ class Core {
int retry = 0;
boolean group = true;
Log.i(folder.name + " executing operations=" + ops.size());
Log.i(folder.name + " executing sequence=" + sequence + " operations=" + ops.size());
while (retry < LOCAL_RETRY_MAX && ops.size() > 0 &&
state.isRunning() &&
state.batchCanRun(folder.id, priority, sequence)) {
@ -679,6 +679,12 @@ class Core {
else {
if (state.batchCanRun(folder.id, priority, sequence))
state.error(new OperationCanceledException("Processing"));
else {
if (state.isProcessing())
Log.e(folder.name + " cannot run " +
" sequence=" + sequence +
" batch=" + state.getBatch(folder.id, priority));
}
}
} finally {
Log.i(folder.name + " end process state=" + state + " pending=" + ops.size());
@ -5359,6 +5365,17 @@ class Core {
}
}
boolean isProcessing() {
return process;
}
Long getBatch(long folder, int priority) {
synchronized (this) {
FolderPriority key = new FolderPriority(folder, priority);
return batch.get(key);
}
}
@NonNull
@Override
public String toString() {

View File

@ -460,7 +460,8 @@ public class EntityOperation {
break;
}
db.operation().deleteOperation(fid, SYNC);
int count = db.operation().deleteOperation(fid, SYNC);
Log.i("Deleted stale sync=" + count);
sync(context, fid, false, force);
}

View File

@ -1878,6 +1878,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
Log.i(folder.name +
" executing partition=" + key +
" sequence=" + sequence +
" operations=" + partition.size());
// Get folder