commit deffa464e38881342d42d0a55f04fd052791de94
parent cb41a2ecd6898181dc35440964d0c60ed781ae11
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 17 Nov 2013 14:04:26 -0500
Don't try more than 5 times to fill 500K limit
This will hopefully fix freezes during full-text syncs.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js
@@ -595,6 +595,8 @@ Zotero.Fulltext = new function(){
+ " ORDER BY clientDateModified DESC";
var rows = Zotero.DB.query(sql) || [];
var libraryIsEditable = {};
+ var skips = 0;
+ var maxSkips = 5;
for each (let row in rows) {
let text;
let itemID = row.itemID;
@@ -669,6 +671,11 @@ Zotero.Fulltext = new function(){
// If this isn't the first item and it would put us over the limit,
// skip it
if (!first && maxChars && ((chars + text.length) > maxChars)) {
+ // Don't try more than maxSkips times to fill up to the limit
+ skips++;
+ if (skips == maxSkips) {
+ break;
+ }
continue;
}
chars += text.length;