🐛 Notebook data may be corrupted during data synchronization https://github.com/siyuan-note/siyuan/issues/9594

This commit is contained in:
Daniel 2023-11-06 22:13:04 +08:00
parent a721bbe6f0
commit 70c56c8e25
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
24 changed files with 88 additions and 96 deletions

View file

@ -18,7 +18,6 @@ package api
import (
"net/http"
"os"
"path/filepath"
"strings"
@ -153,12 +152,12 @@ func getFileAnnotation(c *gin.Context) {
ret.Data = map[string]interface{}{"closeTimeout": 5000}
return
}
if !gulu.File.IsExist(readPath) {
if !filelock.IsExist(readPath) {
ret.Code = 1
return
}
data, err := os.ReadFile(readPath)
data, err := filelock.ReadFile(readPath)
if nil != err {
ret.Code = -1
ret.Msg = err.Error()