Run FTS insert in transaction

This commit is contained in:
M66B 2020-01-21 08:17:24 +01:00
parent 09777904ac
commit 023ebe2f33
1 changed files with 7 additions and 1 deletions

View File

@ -72,7 +72,13 @@ public class WorkerFts extends Worker {
File file = message.getFile(getApplicationContext());
String html = Helper.readText(file);
String text = HtmlHelper.getText(html);
FtsDbHelper.insert(sdb, message, text);
try {
sdb.beginTransaction();
FtsDbHelper.insert(sdb, message, text);
sdb.setTransactionSuccessful();
} finally {
sdb.endTransaction();
}
indexed++;