mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 07:01:05 +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 fts = prefs.getBoolean("fts", true);
|
||||||
boolean cleanup_attachments = prefs.getBoolean("cleanup_attachments", false);
|
boolean cleanup_attachments = prefs.getBoolean("cleanup_attachments", false);
|
||||||
|
|
||||||
|
long start = new Date().getTime();
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
try {
|
try {
|
||||||
Log.i("Start cleanup manual=" + manual);
|
EntityLog.log(context, "Start cleanup manual=" + manual);
|
||||||
|
|
||||||
if (manual) {
|
if (manual) {
|
||||||
// Check message files
|
// Check message files
|
||||||
|
@ -295,11 +296,11 @@ public class WorkerCleanup extends Worker {
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
// https://sqlite.org/lang_analyze.html
|
// https://sqlite.org/lang_analyze.html
|
||||||
Log.i("Analyze");
|
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;")) {
|
try (Cursor cursor = db.getOpenHelper().getWritableDatabase().query("PRAGMA analysis_limit=1000; PRAGMA optimize;")) {
|
||||||
cursor.moveToNext();
|
cursor.moveToNext();
|
||||||
}
|
}
|
||||||
EntityLog.log(context, "Analyze=" + (new Date().getTime() - start) + " ms");
|
EntityLog.log(context, "Analyze=" + (new Date().getTime() - analyze) + " ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (manual) {
|
if (manual) {
|
||||||
|
@ -319,7 +320,7 @@ public class WorkerCleanup extends Worker {
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
} finally {
|
} finally {
|
||||||
Log.i("End cleanup");
|
EntityLog.log(context, "End cleanup=" + (new Date().getTime() - start) + " ms");
|
||||||
|
|
||||||
long now = new Date().getTime();
|
long now = new Date().getTime();
|
||||||
prefs.edit()
|
prefs.edit()
|
||||||
|
|
Loading…
Reference in a new issue