mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Debug: checkpoint RESTART
This commit is contained in:
parent
fa2dbccf88
commit
fe6686dda2
1 changed files with 4 additions and 2 deletions
|
@ -2378,7 +2378,8 @@ public abstract class DB extends RoomDatabase {
|
|||
long start = new Date().getTime();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
SupportSQLiteDatabase sdb = db.getOpenHelper().getWritableDatabase();
|
||||
try (Cursor cursor = sdb.query("PRAGMA wal_checkpoint(PASSIVE);")) {
|
||||
String mode = (BuildConfig.DEBUG ? "RESTART" : "PASSIVE");
|
||||
try (Cursor cursor = sdb.query("PRAGMA wal_checkpoint(" + mode + ");")) {
|
||||
if (cursor.moveToNext()) {
|
||||
for (int i = 0; i < cursor.getColumnCount(); i++) {
|
||||
if (i > 0)
|
||||
|
@ -2389,7 +2390,8 @@ public abstract class DB extends RoomDatabase {
|
|||
}
|
||||
|
||||
long elapse = new Date().getTime() - start;
|
||||
Log.i("PRAGMA wal_checkpoint=" + sb + " elapse=" + elapse);
|
||||
EntityLog.log(context, EntityLog.Type.Debug,
|
||||
"PRAGMA wal_checkpoint(" + mode + ")=" + sb + " elapse=" + elapse + " ms");
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue