mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
I like it extra clean
This commit is contained in:
parent
f88289b863
commit
c3349f0665
2 changed files with 9 additions and 3 deletions
|
@ -105,8 +105,11 @@ public interface DaoAttachment {
|
||||||
" JOIN folder ON folder.id = message.folder" +
|
" JOIN folder ON folder.id = message.folder" +
|
||||||
" WHERE a.id = attachment.id" +
|
" WHERE a.id = attachment.id" +
|
||||||
" AND a.available" +
|
" AND a.available" +
|
||||||
" AND message.stored < :now - folder.sync_days * 24 * 3600 * 1000)")
|
" AND (message.stored < :now - folder.sync_days * 24 * 3600 * 1000" +
|
||||||
int purge(long now);
|
" OR (:extra AND" +
|
||||||
|
" (folder.type = '" + EntityFolder.TRASH + "'" +
|
||||||
|
" OR folder.type = '" + EntityFolder.JUNK + "'))))")
|
||||||
|
int purge(long now, boolean extra);
|
||||||
|
|
||||||
@Insert
|
@Insert
|
||||||
long insertAttachment(EntityAttachment attachment);
|
long insertAttachment(EntityAttachment attachment);
|
||||||
|
|
|
@ -33,6 +33,8 @@ import androidx.work.WorkManager;
|
||||||
import androidx.work.Worker;
|
import androidx.work.Worker;
|
||||||
import androidx.work.WorkerParameters;
|
import androidx.work.WorkerParameters;
|
||||||
|
|
||||||
|
import net.openid.appauth.BuildConfig;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -92,7 +94,8 @@ public class WorkerCleanup extends Worker {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cleanup_attachments) {
|
if (cleanup_attachments) {
|
||||||
int purged = db.attachment().purge(new Date().getTime());
|
int purged = db.attachment().purge(
|
||||||
|
new Date().getTime(), BuildConfig.DEBUG);
|
||||||
Log.i("Attachments purged=" + purged);
|
Log.i("Attachments purged=" + purged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue