mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-03 21:55:13 +00:00
Queue fetch for message added/remove in transaction
This commit is contained in:
parent
e5e17a7e9d
commit
c6d38bf032
1 changed files with 22 additions and 6 deletions
|
@ -1004,9 +1004,17 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
wlMessage.acquire();
|
||||
Log.i(folder.name + " messages added");
|
||||
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid);
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid);
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
Log.e(folder.name, ex);
|
||||
|
@ -1025,9 +1033,17 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
wlMessage.acquire();
|
||||
Log.i(folder.name + " messages removed");
|
||||
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid);
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
for (Message imessage : e.getMessages()) {
|
||||
long uid = ifolder.getUID(imessage);
|
||||
EntityOperation.queue(ServiceSynchronize.this, folder, EntityOperation.FETCH, uid);
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
Log.e(folder.name, ex);
|
||||
|
|
Loading…
Reference in a new issue