🎨 Improve kernel stability by eliminating some data races https://github.com/siyuan-note/siyuan/issues/9842

This commit is contained in:
Daniel 2023-12-11 00:45:23 +08:00
parent 3b3a0cf161
commit 99a2d32abf
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 6 additions and 11 deletions

View file

@ -93,7 +93,6 @@ func index(boxID string) {
treeCount++
i := treeCount
lock.Unlock()
logging.LogInfof("indexing [%s, %d]", file.path, i)
tree, err := filesys.LoadTree(box.ID, file.path, luteEngine)
if nil != err {
logging.LogErrorf("read box [%s] tree [%s] failed: %s", box.ID, file.path, err)
@ -117,17 +116,13 @@ func index(boxID string) {
if 1 < i && 0 == i%64 {
util.PushStatusBar(fmt.Sprintf(Conf.Language(88), i, (len(files))-i))
}
logging.LogInfof("indexed [%s, %d]", file.path, i)
})
i := 0
for _, file := range files {
if file.isdir || !strings.HasSuffix(file.name, ".sy") {
continue
}
waitGroup.Add(1)
i++
logging.LogInfof("[%s, %d]", file.path, i)
invokeErr := p.Invoke(file)
if nil != invokeErr {
logging.LogErrorf("invoke [%s] failed: %s", file.path, invokeErr)