From b7fa1e890334cc636b995241e0a32bfd60832eaa Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 19 Aug 2025 03:28:24 -0400 Subject: [PATCH] Fix slow purging of creators Same as e532e435f but for creators --- chrome/content/zotero/xpcom/data/creators.js | 8 +++++--- chrome/content/zotero/xpcom/zotero.js | 4 +--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/creators.js b/chrome/content/zotero/xpcom/data/creators.js index f68c242a7c..a4de41e56d 100644 --- a/chrome/content/zotero/xpcom/data/creators.js +++ b/chrome/content/zotero/xpcom/data/creators.js @@ -152,9 +152,11 @@ Zotero.Creators = new function() { delete _cache[toDelete[i]]; } - var sql = "DELETE FROM creators WHERE creatorID NOT IN " - + "(SELECT creatorID FROM itemCreators)"; - yield Zotero.DB.queryAsync(sql); + yield Zotero.DB.executeTransaction(async function () { + var sql = "DELETE FROM creators WHERE creatorID NOT IN " + + "(SELECT creatorID FROM itemCreators)"; + await Zotero.DB.queryAsync(sql, [], { ignoreDBLock: true }); + }, { disableForeignKeys: true }); } Zotero.Prefs.set('purge.creators', false); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 650505c364..0ba6b1c895 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1735,9 +1735,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); this.purgeDataObjects = Zotero.Promise.coroutine(function* () { var d = new Date(); - yield Zotero.DB.executeTransaction(async function () { - return Zotero.Creators.purge(); - }); + yield Zotero.Creators.purge(); yield Zotero.DB.executeTransaction(async function () { return Zotero.Tags.purge(); });