🎨 文件系统读取或写入失败时退出内核 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

@ -194,12 +194,6 @@ func checkBlockExist(c *gin.Context) {
id := arg["id"].(string)
b, err := model.GetBlock(id, nil)
// TODO 文件被锁的情况已经在 filelock 中做了退出进程处理,不会走到应用层,所以 code 为 2 的情况应该移除
//if errors.Is(err, filelock.ErrUnableAccessFile) {
// ret.Code = 2
// ret.Data = id
// return
//}
if errors.Is(err, model.ErrIndexing) {
ret.Code = 0
ret.Data = false
@ -405,11 +399,6 @@ func getBlockInfo(c *gin.Context) {
id := arg["id"].(string)
tree, err := model.LoadTreeByID(id)
//if errors.Is(err, filelock.ErrUnableAccessFile) {
// ret.Code = 2
// ret.Data = id
// return
//}
if errors.Is(err, model.ErrIndexing) {
ret.Code = 3
ret.Msg = model.Conf.Language(56)
@ -438,11 +427,6 @@ func getBlockInfo(c *gin.Context) {
}
root, err := model.GetBlock(block.RootID, tree)
//if errors.Is(err, filelock.ErrUnableAccessFile) {
// ret.Code = 2
// ret.Data = id
// return
//}
if errors.Is(err, model.ErrIndexing) {
ret.Code = 3
ret.Data = model.Conf.Language(56)