Ignore errors from individual files when rebuilding index
This commit is contained in:
parent
5a8d669ecc
commit
43ff47be5b
1 changed files with 15 additions and 3 deletions
|
@ -502,7 +502,7 @@ Zotero.Fulltext = new function(){
|
|||
}
|
||||
|
||||
|
||||
function indexItems(items, complete) {
|
||||
function indexItems(items, complete, ignoreErrors) {
|
||||
if (items.constructor.name != 'Array') {
|
||||
items = [items];
|
||||
}
|
||||
|
@ -522,7 +522,19 @@ Zotero.Fulltext = new function(){
|
|||
continue;
|
||||
}
|
||||
|
||||
this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete);
|
||||
if (ignoreErrors) {
|
||||
try {
|
||||
this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.debug(e, 1);
|
||||
Components.utils.reportError("Error indexing " + file.path);
|
||||
Components.utils.reportError(e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete);
|
||||
}
|
||||
}
|
||||
|
||||
Zotero.DB.commitTransaction();
|
||||
|
@ -902,7 +914,7 @@ Zotero.Fulltext = new function(){
|
|||
if (items) {
|
||||
Zotero.DB.query("DELETE FROM fulltextItemWords WHERE itemID IN (" + sql + ")");
|
||||
Zotero.DB.query("DELETE FROM fulltextItems WHERE itemID IN (" + sql + ")");
|
||||
this.indexItems(items);
|
||||
this.indexItems(items, false, true);
|
||||
}
|
||||
Zotero.DB.commitTransaction();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue