Conditionally init

pull/169/head
M66B 6 years ago
parent 863ba1313f
commit 06dc32d512

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

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

Loading…
Cancel
Save