Prevent prematurely stopping send service

This commit is contained in:
M66B 2019-06-24 10:22:59 +02:00
parent 1141cf735f
commit c9facb64f6
1 changed files with 4 additions and 3 deletions

View File

@ -172,6 +172,10 @@ public class ServiceSend extends LifecycleService {
if (!ConnectionHelper.getNetworkState(ServiceSend.this).isSuitable())
break;
}
if (db.operation().getOperations(outbox.id).size() == 0)
stopSelf();
} catch (Throwable ex) {
Log.e(outbox.name, ex);
db.folder().setFolderError(outbox.id, Helper.formatThrowable(ex));
@ -186,9 +190,6 @@ public class ServiceSend extends LifecycleService {
}
});
}
if (operations.size() == 0)
stopSelf();
}
});