mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🎨 细化云端同步锁提升稳定性 https://github.com/siyuan-note/siyuan/issues/5887
This commit is contained in:
parent
963b409e4e
commit
11e4c88f5a
15 changed files with 110 additions and 106 deletions
|
|
@ -39,6 +39,7 @@ import (
|
|||
"github.com/siyuan-note/httpclient"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/cache"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/search"
|
||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
|
|
@ -141,7 +142,7 @@ func NetImg2LocalAssets(rootID string) (err error) {
|
|||
name = util.FilterFileName(name)
|
||||
name = "net-img-" + name + "-" + ast.NewNodeID() + ext
|
||||
writePath := filepath.Join(util.DataDir, "assets", name)
|
||||
if err = util.WriteFileSafer(writePath, data); nil != err {
|
||||
if err = filesys.WriteFileSafer(writePath, data); nil != err {
|
||||
logging.LogErrorf("write downloaded net img [%s] to local assets [%s] failed: %s", u, writePath, err)
|
||||
return ast.WalkSkipChildren
|
||||
}
|
||||
|
|
@ -383,7 +384,7 @@ func saveWorkspaceAssets(assets []string) {
|
|||
logging.LogErrorf("create assets conf failed: %s", err)
|
||||
return
|
||||
}
|
||||
if err = util.WriteFileSafer(confPath, data); nil != err {
|
||||
if err = filesys.WriteFileSafer(confPath, data); nil != err {
|
||||
logging.LogErrorf("write assets conf failed: %s", err)
|
||||
return
|
||||
}
|
||||
|
|
@ -478,7 +479,7 @@ func RenameAsset(oldPath, newName string) (err error) {
|
|||
|
||||
newName = util.AssetName(newName) + filepath.Ext(oldPath)
|
||||
newPath := "assets/" + newName
|
||||
if err = util.Copy(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err {
|
||||
if err = filesys.Copy(filepath.Join(util.DataDir, oldPath), filepath.Join(util.DataDir, newPath)); nil != err {
|
||||
logging.LogErrorf("copy asset [%s] failed: %s", oldPath, err)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue