From d61fdeda4cbcfce365d348252c7e0ab3582da6dd Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 27 Feb 2012 16:34:24 -0500 Subject: [PATCH] Wait 5 seconds after launch for translator updates (bundled and repo) This isn't ideal, since it could cause an unexplained delay a few seconds after launch on slow systems, but it's better than delaying startup. We'll make this non-blocking post-3.0. --- chrome/content/zotero/xpcom/schema.js | 32 +++++++++++++-------------- chrome/content/zotero/xpcom/zotero.js | 1 - 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 268427349..60bef8d9c 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -205,26 +205,26 @@ Zotero.Schema = new function(){ Zotero.debug(e); } } - - try { - var up4 = this.updateBundledFiles(); - } - catch (e) { - Zotero.debug(e); - Zotero.logError(e); - } - - if (up2 || up3 || up4) { - // Run a manual scraper update if upgraded and pref set - if (Zotero.Prefs.get('automaticScraperUpdates')){ - this.updateFromRepository(2); - } - } } finally { Zotero.UnresponsiveScriptIndicator.enable(); } - return up1 || up2 || up3 || up4; + + // After a delay, start update of bundled files and repo updates + setTimeout(function () { + var up = Zotero.Schema.updateBundledFiles(); + if (up) { + // Run a manual scraper update if upgraded and pref set + if (Zotero.Prefs.get('automaticScraperUpdates')) { + Zotero.Schema.updateFromRepository(2); + } + } + else { + Zotero.Schema.updateFromRepository(); + } + }, 5000); + + return up1 || up2 || up3; } diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index d74e54133..540bdfea4 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -642,7 +642,6 @@ const ZOTERO_CONFIG = { } Zotero.DB.startDummyStatement(); - Zotero.Schema.updateFromRepository(); // Populate combined tables for custom types and fields -- this is likely temporary if (!upgraded && !updated) {