Prevent deleting executing operations

This commit is contained in:
M66B
2020-07-05 08:04:18 +02:00
parent 8d3c057fea
commit 3d13ea3773
2 changed files with 5 additions and 3 deletions

View File

@@ -150,6 +150,8 @@ public interface DaoOperation {
@Query("DELETE FROM operation WHERE id = :id")
int deleteOperation(long id);
@Query("DELETE FROM operation WHERE folder = :folder")
int deleteOperations(long folder);
@Query("DELETE FROM operation" +
" WHERE folder = :folder" +
" AND state <> 'executing'")
int deletePendingOperations(long folder);
}

View File

@@ -414,7 +414,7 @@ public class ServiceSend extends ServiceBase {
db.folder().setFolderError(outbox.id, null);
// Delete pending operations
db.operation().deleteOperations(outbox.id);
db.operation().deletePendingOperations(outbox.id);
// Requeue operations
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);