Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 自动校验数据库索引 https://github.com/siyuan-note/siyuan/issues/7016

Liang Ding7bd973deca60
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index 727ca49b4f..26a88d5693 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -1227,7 +1227,16 @@ func AutoFixIndex() {
}
}
+var autoFixLock = sync.Mutex{}
+
func autoFixIndex() {
+ if util.IsMutexLocked(&autoFixLock) {
+ return
+ }
+
+ autoFixLock.Lock()
+ defer autoFixLock.Unlock()
+
rootUpdated := treenode.GetRootUpdated()
for rootID, updated := range rootUpdated {
root := sql.GetBlock(rootID)