Fix cache being immediately cleared on reload-sync

This commit is contained in:
Junegunn Choi 2022-12-31 09:33:23 +09:00
parent 62c7f59b94
commit 924ffb5a35
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -293,7 +293,7 @@ func Run(opts *Options, version string, revision string) {
if heightUnknown && !deferred { if heightUnknown && !deferred {
determine(!reading) determine(!reading)
} }
reset := clearCache() reset := !useSnapshot && clearCache()
matcher.Reset(snapshot, input(reset), false, !reading, sort, reset) matcher.Reset(snapshot, input(reset), false, !reading, sort, reset)
case EvtSearchNew: case EvtSearchNew:
@ -318,7 +318,7 @@ func Run(opts *Options, version string, revision string) {
if !useSnapshot { if !useSnapshot {
snapshot, _ = chunkList.Snapshot() snapshot, _ = chunkList.Snapshot()
} }
reset := clearCache() reset := !useSnapshot && clearCache()
matcher.Reset(snapshot, input(reset), true, !reading, sort, reset) matcher.Reset(snapshot, input(reset), true, !reading, sort, reset)
delay = false delay = false