mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🐛 Notebook data may be corrupted during data synchronization https://github.com/siyuan-note/siyuan/issues/9594
This commit is contained in:
parent
a721bbe6f0
commit
70c56c8e25
24 changed files with 88 additions and 96 deletions
|
|
@ -111,7 +111,7 @@ func ListNotebooks() (ret []*Box, err error) {
|
|||
boxConf := conf.NewBoxConf()
|
||||
boxDirPath := filepath.Join(util.DataDir, dir.Name())
|
||||
boxConfPath := filepath.Join(boxDirPath, ".siyuan", "conf.json")
|
||||
if !gulu.File.IsExist(boxConfPath) {
|
||||
if !filelock.IsExist(boxConfPath) {
|
||||
// Automatically move corrupted notebook folders to the corrupted folder https://github.com/siyuan-note/siyuan/issues/9202
|
||||
logging.LogWarnf("found a corrupted box [%s]", boxDirPath)
|
||||
to := filepath.Join(util.WorkspaceDir, "corrupted", time.Now().Format("2006-01-02-150405"), dir.Name())
|
||||
|
|
@ -184,7 +184,7 @@ func (box *Box) GetConf() (ret *conf.BoxConf) {
|
|||
ret = conf.NewBoxConf()
|
||||
|
||||
confPath := filepath.Join(util.DataDir, box.ID, ".siyuan/conf.json")
|
||||
if !gulu.File.IsExist(confPath) {
|
||||
if !filelock.IsExist(confPath) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ func (box *Box) Stat(p string) (ret *FileInfo) {
|
|||
}
|
||||
|
||||
func (box *Box) Exist(p string) bool {
|
||||
return gulu.File.IsExist(filepath.Join(util.DataDir, box.ID, p))
|
||||
return filelock.IsExist(filepath.Join(util.DataDir, box.ID, p))
|
||||
}
|
||||
|
||||
func (box *Box) Mkdir(path string) error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue