msgstore: do not build threads when threaded view is off

Commit 3a614e45fc ("threading: enable toggle-threads for server-side
threads") changed the behavior of the msgstore.buildThreads variable to
reflect whether the client needs to build threads or the server will.
However, a call to runThreadbuilder was not updated with an extra
conditional. As a result, threads were built regardless of the state of
the threadedView resulting in a large performance penalty for
non-threaded views with client side threading.

Only run thread builder if threaded view is enabled.

Fixes: 3a614e45fc ("threading: enable toggle-threads for server-side threads")
Reported-by: akspecs <akspecs@gmail.com>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Akspecs <akspecs@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
This commit is contained in:
Tim Culverhouse 2022-07-17 08:03:43 -05:00 committed by Robin Jarry
parent e92573c5d7
commit 04097e8743
1 changed files with 1 additions and 1 deletions

View File

@ -356,7 +356,7 @@ func (store *MessageStore) update() {
if store.onUpdateDirs != nil { if store.onUpdateDirs != nil {
store.onUpdateDirs() store.onUpdateDirs()
} }
if store.BuildThreads() { if store.BuildThreads() && store.ThreadedView() {
store.runThreadBuilder() store.runThreadBuilder()
} }
} }