Don't purge data tables until after schema update
It's no longer necessary to do this before syncing, since tags and creators aren't first-class objects.
This commit is contained in:
parent
69c27cd8a7
commit
1100015d2c
|
@ -848,6 +848,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
Zotero.Feeds.init();
|
Zotero.Feeds.init();
|
||||||
Zotero.addShutdownListener(() => Zotero.Feeds.uninit());
|
Zotero.addShutdownListener(() => Zotero.Feeds.uninit());
|
||||||
|
|
||||||
|
Zotero.Schema.schemaUpdatePromise.then(Zotero.purgeDataObjects.bind(Zotero));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
@ -1987,6 +1989,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
* Clear entries that no longer exist from various tables
|
* Clear entries that no longer exist from various tables
|
||||||
*/
|
*/
|
||||||
this.purgeDataObjects = Zotero.Promise.coroutine(function* () {
|
this.purgeDataObjects = Zotero.Promise.coroutine(function* () {
|
||||||
|
var d = new Date();
|
||||||
|
|
||||||
yield Zotero.DB.executeTransaction(function* () {
|
yield Zotero.DB.executeTransaction(function* () {
|
||||||
return Zotero.Creators.purge();
|
return Zotero.Creators.purge();
|
||||||
});
|
});
|
||||||
|
@ -2001,6 +2005,8 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
//yield Zotero.DB.executeTransaction(function* () {
|
//yield Zotero.DB.executeTransaction(function* () {
|
||||||
// return Zotero.Relations.purge();
|
// return Zotero.Relations.purge();
|
||||||
//});
|
//});
|
||||||
|
|
||||||
|
Zotero.debug("Purged data tables in " + (new Date() - d) + " ms");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -414,11 +414,6 @@ var ZoteroPane = new function()
|
||||||
searchBar.inputField.select();
|
searchBar.inputField.select();
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
var d = new Date();
|
|
||||||
yield Zotero.purgeDataObjects();
|
|
||||||
var d2 = new Date();
|
|
||||||
Zotero.debug("Purged data tables in " + (d2 - d) + " ms");
|
|
||||||
|
|
||||||
// Auto-sync on pane open or if new account
|
// Auto-sync on pane open or if new account
|
||||||
if (Zotero.Prefs.get('sync.autoSync') || Zotero.initAutoSync) {
|
if (Zotero.Prefs.get('sync.autoSync') || Zotero.initAutoSync) {
|
||||||
yield Zotero.proxyAuthComplete;
|
yield Zotero.proxyAuthComplete;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user