Batch delete log entries

This commit is contained in:
M66B
2021-01-17 12:27:28 +01:00
parent d4400bca9d
commit 212a78e638
3 changed files with 19 additions and 5 deletions

View File

@@ -42,6 +42,7 @@ public interface DaoLog {
long insertLog(EntityLog log);
@Query("DELETE FROM log" +
" WHERE time < :before")
int deleteLogs(long before);
" WHERE id IN (SELECT id FROM log" +
" WHERE time < :before ORDER BY time LIMIT :limit)")
int deleteLogs(long before, int limit);
}