mirror of https://github.com/M66B/FairEmail.git
Run FTS insert in transaction
This commit is contained in:
parent
09777904ac
commit
023ebe2f33
|
@ -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++;
|
||||
|
||||
|
|
Loading…
Reference in New Issue