1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 17:57:16 +00:00

Conditionally init

This commit is contained in:
M66B 2019-12-13 08:08:18 +01:00
parent 863ba1313f
commit 06dc32d512
2 changed files with 8 additions and 3 deletions

View file

@ -516,8 +516,11 @@ public class ServiceSend extends ServiceBase {
try {
DB db = DB.getInstance(context);
EntityFolder outbox = db.folder().getOutbox();
if (outbox != null)
if (outbox != null) {
int operations = db.operation().getOperations(outbox.id).size();
if (operations > 0)
start(context);
}
} catch (Throwable ex) {
Log.e(ex);
}

View file

@ -1456,6 +1456,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
schedule(context);
// Init service
int accounts = db.account().getSynchronizingAccounts().size();
if (accounts > 0)
eval(context, "boot");
} catch (Throwable ex) {
Log.e(ex);