Improve data sync performance for booting https://github.com/siyuan-note/siyuan/issues/13216

This commit is contained in:
Daniel 2024-11-21 10:59:29 +08:00
parent eba4dfa0da
commit 89f1887c3b
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
16 changed files with 153 additions and 113 deletions

View file

@ -20,6 +20,7 @@ import (
"bytes"
"errors"
"fmt"
"io/fs"
"os"
"path"
"path/filepath"
@ -1461,11 +1462,11 @@ func MoveDocs(fromPaths []string, toBoxID, toPath string, callback interface{})
func countSubDocs(box, p string) (ret int) {
p = strings.TrimSuffix(p, ".sy")
_ = filepath.Walk(filepath.Join(util.DataDir, box, p), func(path string, info os.FileInfo, err error) error {
_ = filelock.Walk(filepath.Join(util.DataDir, box, p), func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if info.IsDir() {
if d.IsDir() {
return nil
}
if strings.HasSuffix(path, ".sy") {