commit a0d747285966ab29e6f3d346fad2bdbe204186b1
parent d3ddc03dc6d6f131247243690743b9465618f87e
Author: Simon Kornblith <simon@simonster.com>
Date: Fri, 27 Jan 2012 00:02:20 -0500
Don't spin a nested event loop on most startups
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git 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();
}