mirror of
https://github.com/zotero/zotero.git
synced 2026-08-28 05:25:31 +00:00
Skip startup full-text index purge and optimize when unnecessary
Some checks are pending
Some checks are pending
purgeOrphanedContent() ran on every startup, unlike the other data-object purges, which are gated on the purge.* prefs. startQueueDrain() also ran an FTS5 'optimize' even when the queues were empty. Gate the former on purge.items and the latter on having indexed something.
This commit is contained in:
parent
3af8cea1af
commit
8f6dc583b8
2 changed files with 7 additions and 2 deletions
|
|
@ -1817,7 +1817,9 @@ Zotero.Fulltext = Zotero.FullText = new function () {
|
|||
itemProgress.setProgress(100);
|
||||
}
|
||||
}
|
||||
await this.optimizeContentIndex();
|
||||
if (done > 0) {
|
||||
await this.optimizeContentIndex();
|
||||
}
|
||||
// Reclaim the space freed by a rebuild (e.g., an index-format change dropping the old
|
||||
// tables), which can be most of the file; the freelist gate makes this a no-op on
|
||||
// ordinary startups
|
||||
|
|
|
|||
|
|
@ -1971,7 +1971,10 @@ const { CommandLineOptions } = ChromeUtils.importESModule("chrome://zotero/conte
|
|||
await Zotero.DB.executeTransaction(async function () {
|
||||
return Zotero.Tags.purge();
|
||||
});
|
||||
await Zotero.FullText.purgeOrphanedContent();
|
||||
// Items.purge() below resets the pref
|
||||
if (Zotero.Prefs.get('purge.items')) {
|
||||
await Zotero.FullText.purgeOrphanedContent();
|
||||
}
|
||||
await Zotero.Items.purge();
|
||||
// DEBUG: this might not need to be permanent
|
||||
//yield Zotero.DB.executeTransaction(async function () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue