mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
:file: 移除文件锁 https://github.com/siyuan-note/siyuan/issues/6010
This commit is contained in:
parent
56129699b9
commit
69a9713776
38 changed files with 193 additions and 438 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
"github.com/88250/lute/parse"
|
||||
"github.com/88250/lute/render"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/filelock"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
|
|
@ -111,7 +112,7 @@ func html2BlockDOM(c *gin.Context) {
|
|||
name = name[0 : len(name)-len(ext)]
|
||||
name = name + "-" + ast.NewNodeID() + ext
|
||||
targetPath := filepath.Join(util.DataDir, "assets", name)
|
||||
if err = gulu.File.CopyFile(localPath, targetPath); nil != err {
|
||||
if err = filelock.Copy(localPath, targetPath); nil != err {
|
||||
logging.LogErrorf("copy asset from [%s] to [%s] failed: %s", localPath, targetPath, err)
|
||||
return ast.WalkStop
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue