Skip to content

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

:art: `/资源` 支持搜索未索引的文件 https://github.com/siyuan-note/siyuan/issues/5416

Liang Dingd62d929a1861
diff --git a/kernel/cache/asset.go b/kernel/cache/asset.go
index d66fd6a951..c958561b5f 100644
--- a/kernel/cache/asset.go
+++ b/kernel/cache/asset.go
@@ -21,6 +21,7 @@ import (
"path/filepath"
"strings"
"sync"
+ "time"
"github.com/siyuan-note/siyuan/kernel/util"
)
@@ -34,6 +35,7 @@ type Asset struct {
var Assets = sync.Map{}
func LoadAssets() {
+ start := time.Now()
Assets = sync.Map{}
assets := filepath.Join(util.DataDir, "assets")
filepath.Walk(assets, func(path string, info fs.FileInfo, err error) error {
@@ -56,4 +58,8 @@ func LoadAssets() {
})
return nil
})
+ elapsed := time.Since(start)
+ if 2000 < elapsed.Milliseconds() {
+ util.LogInfof("loaded assets [%s]", elapsed)
+ }
}