diff --git a/chrome/content/zotero/xpcom/embeddings.js b/chrome/content/zotero/xpcom/embeddings.js index b48cfbbd25..c5c5f30fc2 100644 --- a/chrome/content/zotero/xpcom/embeddings.js +++ b/chrome/content/zotero/xpcom/embeddings.js @@ -304,6 +304,9 @@ Zotero.Embeddings = new function () { * @return {Promise} - Whether the database was vacuumed */ this.vacuumDB = async function ({ force = false } = {}) { + if (Zotero.DB.inTransaction()) { + await Zotero.DB.waitForTransaction(); + } if (!force) { let freelistCount = await Zotero.DB.valueQueryAsync("PRAGMA embeddings.freelist_count"); let pageCount = await Zotero.DB.valueQueryAsync("PRAGMA embeddings.page_count");