Browse Source

Prevent get/set seen race condition

main
M66B 6 years ago
parent
commit
c588640c7b
2 changed files with 3 additions and 8 deletions
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. +3
    -8
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java

BIN
.idea/caches/build_file_checksums.ser View File


+ 3
- 8
app/src/main/java/eu/faircode/email/ServiceSynchronize.java View File

@ -490,6 +490,9 @@ public class ServiceSynchronize extends LifecycleService {
@Override @Override
public void run() { public void run() {
try { try {
// Process pending operations
processOperations(folder, isession, istore, ifolder);
// Listen for new and deleted messages // Listen for new and deleted messages
ifolder.addMessageCountListener(new MessageCountAdapter() { ifolder.addMessageCountListener(new MessageCountAdapter() {
@Override @Override
@ -715,14 +718,6 @@ public class ServiceSynchronize extends LifecycleService {
lbm.registerReceiver(processFolder, f); lbm.registerReceiver(processFolder, f);
try { try {
// Process pending folder operations
Log.i(Helper.TAG, "listen process folder");
for (final EntityFolder folder : folders.keySet())
if (!EntityFolder.OUTBOX.equals(folder.type))
lbm.sendBroadcast(new Intent(ACTION_PROCESS_OPERATIONS)
.setType("account/" + account.id)
.putExtra("folder", folder.id));
// Keep store alive // Keep store alive
while (state.running && istore.isConnected()) { while (state.running && istore.isConnected()) {
Log.i(Helper.TAG, "Checking folders"); Log.i(Helper.TAG, "Checking folders");


Loading…
Cancel
Save