Wait for DB transaction to end before indexing string
This might help avoid timeouts during indexing. Addresses #1284
This commit is contained in:
parent
1cfc90186f
commit
b50b055e44
1 changed files with 4 additions and 0 deletions
|
@ -261,6 +261,10 @@ Zotero.Fulltext = Zotero.FullText = new function(){
|
|||
var indexString = Zotero.Promise.coroutine(function* (text, charset, itemID, stats, version, synced) {
|
||||
var words = this.semanticSplitter(text, charset);
|
||||
|
||||
while (Zotero.DB.inTransaction()) {
|
||||
yield Zotero.DB.waitForTransaction('indexString()');
|
||||
}
|
||||
|
||||
yield Zotero.DB.executeTransaction(function* () {
|
||||
this.clearItemWords(itemID, true);
|
||||
yield indexWords(itemID, words, stats, version, synced);
|
||||
|
|
Loading…
Reference in a new issue