mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
🎨 细化云端同步锁提升稳定性 https://github.com/siyuan-note/siyuan/issues/5887
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
@@ -85,7 +86,7 @@ func setFileAnnotation(c *gin.Context) {
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
if err := util.WriteFileSafer(writePath, []byte(data)); nil != err {
|
||||
if err := filesys.WriteFileSafer(writePath, []byte(data)); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
|
||||
@@ -30,6 +30,7 @@ import (
|
||||
"github.com/88250/lute/ast"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||
"github.com/siyuan-note/siyuan/kernel/model"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
@@ -106,7 +107,7 @@ func extensionCopy(c *gin.Context) {
|
||||
}
|
||||
fName = fName + "-" + ast.NewNodeID() + ext
|
||||
writePath := filepath.Join(assets, fName)
|
||||
if err = util.WriteFileSafer(writePath, data); nil != err {
|
||||
if err = filesys.WriteFileSafer(writePath, data); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user