Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Upgrade kernel dpes

Danielca37685d086d
diff --git a/kernel/go.mod b/kernel/go.mod
index 566606612d..2eac1c7253 100644
--- a/kernel/go.mod
+++ b/kernel/go.mod
@@ -50,7 +50,7 @@ require (
github.com/siyuan-note/dejavu v0.0.0-20231030071534-4dce9cc8d9af
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80
- github.com/siyuan-note/filelock v0.0.0-20230615140405-d05a21d49524
+ github.com/siyuan-note/filelock v0.0.0-20231030092426-0ff158f5f8ca
github.com/siyuan-note/httpclient v0.0.0-20231028070852-3c2c5a151c13
github.com/siyuan-note/logging v0.0.0-20231030034701-8265764f00ff
github.com/siyuan-note/riff v0.0.0-20230928143458-ffd178c7e0fc
diff --git a/kernel/go.sum b/kernel/go.sum
index c3937bdfe6..ccb44cb0b0 100644
--- a/kernel/go.sum
+++ b/kernel/go.sum
@@ -338,18 +338,14 @@ github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA=
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
-github.com/siyuan-note/dejavu v0.0.0-20231030033735-e1159566cf1f h1:qcnlaDdl74QBBJcTts4g46Fjoo2bftHQZe63DN91/lc=
-github.com/siyuan-note/dejavu v0.0.0-20231030033735-e1159566cf1f/go.mod h1:sI8koptyofmnE4zcS6/HhOCHmxUcOSvr8ZYF0EqOku4=
-github.com/siyuan-note/dejavu v0.0.0-20231030035026-e16dd926f8aa h1:jNdF6vITlStzrVaJVT05hsT5ItZiJWlAbQt2hJu+E8A=
-github.com/siyuan-note/dejavu v0.0.0-20231030035026-e16dd926f8aa/go.mod h1:sI8koptyofmnE4zcS6/HhOCHmxUcOSvr8ZYF0EqOku4=
github.com/siyuan-note/dejavu v0.0.0-20231030071534-4dce9cc8d9af h1:C2vF0KJUODTW9Q06NcmP2zPfTDz0plOyDRoIAePKZD4=
github.com/siyuan-note/dejavu v0.0.0-20231030071534-4dce9cc8d9af/go.mod h1:l/akstKweKTdzTZ3FxFH2d49ekEbs9dAFmzDiM7tBik=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80 h1:XghjHKJd+SiL0DkGYFVC+UGUDFtnR4v9gkAbPeh9Eq8=
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80/go.mod h1:Sqo4FYX5lAXu7gWkbEdJF0e6P57tNNVV4WDKYDctokI=
-github.com/siyuan-note/filelock v0.0.0-20230615140405-d05a21d49524 h1:ZuxN5gwqtUOd1NkOkNhM4OlVWfjujY98zsR+zFi4x9g=
-github.com/siyuan-note/filelock v0.0.0-20230615140405-d05a21d49524/go.mod h1:jK5lCYfPbFOrW23/HMeU7kmpLdEd5GkennF+kUpy7Vs=
+github.com/siyuan-note/filelock v0.0.0-20231030092426-0ff158f5f8ca h1:e0+lU1gxFXV+SOjuce4H2QH9VNfAibXbPyuU+dlC4wk=
+github.com/siyuan-note/filelock v0.0.0-20231030092426-0ff158f5f8ca/go.mod h1:H735iw2ycTmG31yNWu4/zEzFtYUSTTcY3DPEV8y98IQ=
github.com/siyuan-note/httpclient v0.0.0-20231028070852-3c2c5a151c13 h1:DQwiRQa63wsjSKQN5TvTWI2Dd5XSulhnXvxIdOG8/x8=
github.com/siyuan-note/httpclient v0.0.0-20231028070852-3c2c5a151c13/go.mod h1:mS0nX5fX99R/5HLnKqG40kpbathSCXxL/oxe88rURNI=
github.com/siyuan-note/logging v0.0.0-20231030034701-8265764f00ff h1:5GcxrTOJTsusXOLhg4GuHWbEa4M5gu+CNfL0giwNjDM=
diff --git a/kernel/model/box.go b/kernel/model/box.go
index ca15044815..f43010af23 100644
--- a/kernel/model/box.go
+++ b/kernel/model/box.go
@@ -333,7 +333,7 @@ func (box *Box) Move(oldPath, newPath string) error {
fromPath := filepath.Join(boxLocalPath, oldPath)
toPath := filepath.Join(boxLocalPath, newPath)
- if err := filelock.Move(fromPath, toPath); nil != err {
+ if err := filelock.Rename(fromPath, toPath); nil != err {
msg := fmt.Sprintf(Conf.Language(5), box.Name, fromPath, err)
logging.LogErrorf("move [path=%s] in box [%s] failed: %s", fromPath, box.Name, err)
return errors.New(msg)
diff --git a/kernel/model/file.go b/kernel/model/file.go
index 15d29c4aea..59cc79ecf1 100644
--- a/kernel/model/file.go
+++ b/kernel/model/file.go
@@ -1208,7 +1208,7 @@ func moveDoc(fromBox *Box, fromPath string, toBox *Box, toPath string, luteEngin
if gulu.File.IsExist(absToPath) {
filelock.Remove(absToPath)
}
- if err = filelock.Move(absFromPath, absToPath); nil != err {
+ if err = filelock.Rename(absFromPath, absToPath); nil != err {
msg := fmt.Sprintf(Conf.Language(5), fromBox.Name, fromPath, err)
logging.LogErrorf("move [path=%s] in box [%s] failed: %s", fromPath, fromBox.ID, err)
err = errors.New(msg)
@@ -1233,7 +1233,7 @@ func moveDoc(fromBox *Box, fromPath string, toBox *Box, toPath string, luteEngin
} else {
absFromPath := filepath.Join(util.DataDir, fromBox.ID, fromPath)
absToPath := filepath.Join(util.DataDir, toBox.ID, newPath)
- if err = filelock.Move(absFromPath, absToPath); nil != err {
+ if err = filelock.Rename(absFromPath, absToPath); nil != err {
msg := fmt.Sprintf(Conf.Language(5), fromBox.Name, fromPath, err)
logging.LogErrorf("move [path=%s] in box [%s] failed: %s", fromPath, fromBox.ID, err)
err = errors.New(msg)
diff --git a/kernel/model/import.go b/kernel/model/import.go
index ec6f9c198b..12028a0ff8 100644
--- a/kernel/model/import.go
+++ b/kernel/model/import.go
@@ -337,7 +337,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
return
}
newSyPath := filepath.Join(filepath.Dir(syPath), tree.ID+".sy")
- if err = filelock.Move(syPath, newSyPath); nil != err {
+ if err = filelock.Rename(syPath, newSyPath); nil != err {
logging.LogErrorf("rename .sy from [%s] to [%s] failed: %s", syPath, newSyPath, err)
return
}
@@ -437,7 +437,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
})
for i, oldPath := range oldPaths {
newPath := renamePaths[oldPath]
- if err = filelock.Move(oldPath, newPath); nil != err {
+ if err = filelock.Rename(oldPath, newPath); nil != err {
logging.LogErrorf("rename path from [%s] to [%s] failed: %s", oldPath, renamePaths[oldPath], err)
return errors.New("rename path failed")
}
diff --git a/kernel/model/transaction.go b/kernel/model/transaction.go
index 24608eacc5..71c2056320 100644
--- a/kernel/model/transaction.go
+++ b/kernel/model/transaction.go
@@ -799,7 +799,7 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {
// 只有全局 assets 才移动到相对 assets
targetP := filepath.Join(assets, filepath.Base(assetPath))
- if e = filelock.Move(assetPath, targetP); nil != err {
+ if e = filelock.Rename(assetPath, targetP); nil != err {
logging.LogErrorf("copy path of asset from [%s] to [%s] failed: %s", assetPath, targetP, err)
return ast.WalkContinue
}