mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
⚡ Improve data sync performance for booting https://github.com/siyuan-note/siyuan/issues/13216
This commit is contained in:
parent
eba4dfa0da
commit
89f1887c3b
16 changed files with 153 additions and 113 deletions
|
|
@ -387,13 +387,13 @@ func (searcher *AssetsSearcher) FullIndex() {
|
|||
}
|
||||
|
||||
var results []*AssetParseResult
|
||||
filelock.Walk(assetsDir, func(absPath string, info fs.FileInfo, err error) error {
|
||||
filelock.Walk(assetsDir, func(absPath string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
logging.LogErrorf("walk dir [%s] failed: %s", absPath, err)
|
||||
return err
|
||||
}
|
||||
|
||||
if info.IsDir() {
|
||||
if d.IsDir() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -410,6 +410,12 @@ func (searcher *AssetsSearcher) FullIndex() {
|
|||
return nil
|
||||
}
|
||||
|
||||
info, err := d.Info()
|
||||
if err != nil {
|
||||
logging.LogErrorf("stat file [%s] failed: %s", absPath, err)
|
||||
return nil
|
||||
}
|
||||
|
||||
result.Path = "assets" + filepath.ToSlash(strings.TrimPrefix(absPath, assetsDir))
|
||||
result.Size = info.Size()
|
||||
result.Updated = info.ModTime().Unix()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue