mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +00:00
Added cleanup logging
This commit is contained in:
parent
46bf264f1c
commit
a5cd738782
1 changed files with 5 additions and 4 deletions
|
@ -92,9 +92,10 @@ public class WorkerCleanup extends Worker {
|
|||
boolean fts = prefs.getBoolean("fts", true);
|
||||
boolean cleanup_attachments = prefs.getBoolean("cleanup_attachments", false);
|
||||
|
||||
long start = new Date().getTime();
|
||||
DB db = DB.getInstance(context);
|
||||
try {
|
||||
Log.i("Start cleanup manual=" + manual);
|
||||
EntityLog.log(context, "Start cleanup manual=" + manual);
|
||||
|
||||
if (manual) {
|
||||
// Check message files
|
||||
|
@ -295,11 +296,11 @@ public class WorkerCleanup extends Worker {
|
|||
if (BuildConfig.DEBUG) {
|
||||
// https://sqlite.org/lang_analyze.html
|
||||
Log.i("Analyze");
|
||||
long start = new Date().getTime();
|
||||
long analyze = new Date().getTime();
|
||||
try (Cursor cursor = db.getOpenHelper().getWritableDatabase().query("PRAGMA analysis_limit=1000; PRAGMA optimize;")) {
|
||||
cursor.moveToNext();
|
||||
}
|
||||
EntityLog.log(context, "Analyze=" + (new Date().getTime() - start) + " ms");
|
||||
EntityLog.log(context, "Analyze=" + (new Date().getTime() - analyze) + " ms");
|
||||
}
|
||||
|
||||
if (manual) {
|
||||
|
@ -319,7 +320,7 @@ public class WorkerCleanup extends Worker {
|
|||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
} finally {
|
||||
Log.i("End cleanup");
|
||||
EntityLog.log(context, "End cleanup=" + (new Date().getTime() - start) + " ms");
|
||||
|
||||
long now = new Date().getTime();
|
||||
prefs.edit()
|
||||
|
|
Loading…
Reference in a new issue