mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-11 02:30:21 +08:00
Revert "[client-app] Properly re-index threads when their data has changed"
Temporarily reverting this commit for 1.0.30 release because it is causing
performance issues: https://phab.nylas.com/T7910
This reverts commit 5e35d39eb2
.
This commit is contained in:
parent
5714a23501
commit
0294db95cf
1 changed files with 1 additions and 10 deletions
|
@ -122,21 +122,12 @@ class ThreadSearchIndexStore {
|
|||
if (change.objectClass !== Thread.name) {
|
||||
return;
|
||||
}
|
||||
_.defer(async () => {
|
||||
_.defer(() => {
|
||||
const {objects, type} = change
|
||||
const threads = objects;
|
||||
|
||||
let promises = []
|
||||
if (type === 'persist') {
|
||||
const alreadyIndexedThreads = threads.filter(t => t.isSearchIndexed)
|
||||
if (alreadyIndexedThreads.length > 0) {
|
||||
alreadyIndexedThreads.forEach(thread => {
|
||||
// Mark already indexed threads as unindexed so that we re-index them
|
||||
// with updates
|
||||
thread.isSearchIndexed = false
|
||||
})
|
||||
await DatabaseStore.inTransaction(t => t.persistModels(alreadyIndexedThreads))
|
||||
}
|
||||
this.indexer.notifyHasIndexingToDo();
|
||||
} else if (type === 'unpersist') {
|
||||
promises = threads.map(thread => this.unindexThread(thread,
|
||||
|
|
Loading…
Reference in a new issue