Merge pull request #1238 from niaow/fix-snapshot-queue

Fix automatic snapshot queue enable check
This commit is contained in:
Nia 2020-12-16 17:01:09 -05:00 committed by GitHub
commit 26ab79ecb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View file

@ -782,12 +782,8 @@ func (h *Holder) Close() error {
func (h *Holder) NeedsSnapshot() bool {
h.mu.RLock()
defer h.mu.RUnlock()
for _, idx := range h.Indexes() {
if idx.NeedsSnapshot() {
return true
}
}
return false
return h.txf.NeedsSnapshot()
}
// HasData returns true if Holder contains at least one index.

View file

@ -88,7 +88,7 @@ type Server struct { // nolint: maligned
dataDir string
// Threshold for logging long-running queries
longQueryTime time.Duration
longQueryTime time.Duration
queryHistoryLength int
}