From a0d747285966ab29e6f3d346fad2bdbe204186b1 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Fri, 27 Jan 2012 00:02:20 -0500 Subject: [PATCH] Don't spin a nested event loop on most startups --- chrome/content/zotero/xpcom/schema.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 2d8b4dc75..7686271a4 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -131,9 +131,8 @@ Zotero.Schema = new function(){ // If upgrading userdata, make backup of database first if (dbVersion < schemaVersion){ Zotero.DB.backupDatabase(dbVersion); - } - - Zotero.wait(1000); + Zotero.wait(1000); + } Zotero.DB.beginTransaction(); @@ -159,14 +158,14 @@ Zotero.Schema = new function(){ if (Zotero.DB.tableExists('customItemTypes')) { this.updateCustomTables(up2); } - Zotero.wait(); + if(up2) Zotero.wait(); var up1 = _migrateUserDataSchema(dbVersion); var up3 = _updateSchema('triggers'); // Update custom tables again in case custom fields were changed during user data migration if (up1) { this.updateCustomTables(); } - Zotero.wait(); + if(up1) Zotero.wait(); Zotero.DB.commitTransaction(); }