diff --git a/app/src/main/java/eu/faircode/email/WorkerCleanup.java b/app/src/main/java/eu/faircode/email/WorkerCleanup.java index bba86404ca..27da74acb6 100644 --- a/app/src/main/java/eu/faircode/email/WorkerCleanup.java +++ b/app/src/main/java/eu/faircode/email/WorkerCleanup.java @@ -93,12 +93,6 @@ public class WorkerCleanup extends Worker { } } - if (cleanup_attachments) { - int purged = db.attachment().purge( - new Date().getTime(), BuildConfig.DEBUG); - Log.i("Attachments purged=" + purged); - } - // Check attachments files Log.i("Checking attachments files"); List aids = db.attachment().getAttachmentAvailable(); @@ -113,6 +107,13 @@ public class WorkerCleanup extends Worker { } } + // Delete old attachments + if (cleanup_attachments) { + int purged = db.attachment().purge( + new Date().getTime(), BuildConfig.DEBUG); + Log.i("Attachments purged=" + purged); + } + // Clear raw headers int headers = db.message().clearMessageHeaders(); Log.i("Cleared message headers=" + headers);