🎨 文件系统读取或写入失败时退出内核 https://github.com/siyuan-note/siyuan/issues/7707

This commit is contained in:
Liang Ding 2023-03-19 17:12:52 +08:00
parent 60f390d9e0
commit 7a078d3689
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
18 changed files with 3 additions and 162 deletions

View file

@ -501,24 +501,6 @@ func createDocWithMd(c *gin.Context) {
pushCreate(box, p, id, arg)
}
func lockFile(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
id := arg["id"].(string)
locked := model.TryAccessFileByBlockID(id)
if !locked {
ret.Code = -1
ret.Msg = fmt.Sprintf(model.Conf.Language(75))
ret.Data = map[string]interface{}{"closeTimeout": 5000}
}
}
func getDocCreateSavePath(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
@ -689,11 +671,6 @@ func getDoc(c *gin.Context) {
}
blockCount, content, parentID, parent2ID, rootID, typ, eof, scroll, boxID, docPath, isBacklinkExpand, err := model.GetDoc(startID, endID, id, index, keyword, mode, size, isBacklink)
//if errors.Is(err, filelock.ErrUnableAccessFile) {
// ret.Code = 2
// ret.Data = id
// return
//}
if model.ErrBlockNotFound == err {
ret.Code = 3
return