🎨 重建索引前清空数据库队列

This commit is contained in:
Liang Ding
2023-01-09 00:04:49 +08:00
parent 3f1cbb2d1d
commit 248eecb871
2 changed files with 7 additions and 0 deletions

View File

@@ -85,6 +85,12 @@ func IsEmptyQueue() bool {
return 1 > len(operationQueue) && !util.IsMutexLocked(&txLock)
}
func ClearQueue() {
upsertTreeQueueLock.Lock()
defer upsertTreeQueueLock.Unlock()
operationQueue = nil
}
func flushTreeQueue() {
ops := mergeUpsertTrees()
if 1 > len(ops) {