mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +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
|
|
@ -18,10 +18,10 @@ package sql
|
|||
|
||||
import (
|
||||
"database/sql"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
|
|
@ -139,17 +139,17 @@ func scanAssetRows(rows *sql.Rows) (ret *Asset) {
|
|||
|
||||
func assetLocalPath(linkDest, boxLocalPath, docDirLocalPath string) (ret string) {
|
||||
ret = filepath.Join(docDirLocalPath, linkDest)
|
||||
if gulu.File.IsExist(ret) {
|
||||
if filelock.IsExist(ret) {
|
||||
return
|
||||
}
|
||||
|
||||
ret = filepath.Join(boxLocalPath, linkDest)
|
||||
if gulu.File.IsExist(ret) {
|
||||
if filelock.IsExist(ret) {
|
||||
return
|
||||
}
|
||||
|
||||
ret = filepath.Join(util.DataDir, linkDest)
|
||||
if gulu.File.IsExist(ret) {
|
||||
if filelock.IsExist(ret) {
|
||||
return
|
||||
}
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue