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/5159

Liang Dinga0e1e2249aa3
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index 561a9071ac..9950b91354 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -23,7 +23,9 @@ import (
"os"
"github.com/siyuan-note/dejavu"
+ "github.com/siyuan-note/dejavu/entity"
"github.com/siyuan-note/encryption"
+ "github.com/siyuan-note/siyuan/kernel/filesys"
"github.com/siyuan-note/siyuan/kernel/util"
)
@@ -96,10 +98,10 @@ var indexCallbacks = map[string]dejavu.Callback{
context.(func(msg string))(arg.(string))
},
"getLatestFile": func(context, arg interface{}, err error) {
- context.(func(msg string))(arg.(string))
+ context.(func(msg string))(arg.(*entity.File).Path)
},
"upsertFile": func(context, arg interface{}, err error) {
- context.(func(msg string))(arg.(string))
+ context.(func(msg string))(arg.(*entity.File).Path)
},
}
@@ -114,6 +116,10 @@ func IndexRepo(message string) (err error) {
return
}
+ WaitForWritingFiles()
+ syncLock.Lock()
+ defer syncLock.Unlock()
+ filesys.ReleaseAllFileLocks()
_, err = repo.Index(message, util.PushEndlessProgress, indexCallbacks)
util.PushClearProgress()
return