Run FTS insert in transaction

pull/172/head
M66B 5 years ago
parent 09777904ac
commit 023ebe2f33

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

Loading…
Cancel
Save