1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Cleanup photos

This commit is contained in:
M66B 2020-01-08 08:58:30 +01:00
parent d66074790e
commit 0a1b1dc991

View file

@ -184,6 +184,15 @@ public class WorkerCleanup extends Worker {
}
}
Log.i("Cleanup photos");
File[] photos = new File(context.getCacheDir(), "photo").listFiles();
if (photos != null)
for (File file : photos)
if (manual || file.lastModified() + KEEP_FILES_DURATION < now) {
if (!file.delete())
Log.w("Error deleting " + file);
}
Log.i("Cleanup contacts");
int contacts = db.contact().deleteContacts(now - KEEP_CONTACTS_DURATION);
Log.i("Deleted contacts=" + contacts);