mirror of https://github.com/M66B/FairEmail.git
Service boot transaction
This commit is contained in:
parent
5abca1603a
commit
54f1948886
|
@ -1566,6 +1566,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
public void run() {
|
||||
try {
|
||||
DB db = DB.getInstance(context);
|
||||
try {
|
||||
db.beginTransaction();
|
||||
|
||||
// Reset accounts
|
||||
for (EntityAccount account : db.account().getAccounts())
|
||||
|
@ -1584,6 +1586,11 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
|||
for (EntityMessage message : db.message().getSnoozed())
|
||||
EntityMessage.snooze(context, message.id, message.ui_snoozed);
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
// Restore schedule
|
||||
schedule(context);
|
||||
|
||||
|
|
Loading…
Reference in New Issue