Skip to content

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

:bug: 缓存参数设置不正确 Fix https://github.com/siyuan-note/siyuan/issues/5318

Liang Ding4d4c5b58b9d8
diff --git a/kernel/cache/ial.go b/kernel/cache/ial.go
index f8cacaf8d0..55b7596baa 100644
--- a/kernel/cache/ial.go
+++ b/kernel/cache/ial.go
@@ -24,8 +24,8 @@ import (
)
var docIALCache, _ = ristretto.NewCache(&ristretto.Config{
- NumCounters: 100000, // 10W
- MaxCost: 1024 * 1024 * 10, // 10MB
+ NumCounters: 200000,
+ MaxCost: 1000 * 1000 * 32,
BufferItems: 64,
})
@@ -55,8 +55,8 @@ func ClearDocsIAL() {
}
var blockIALCache, _ = ristretto.NewCache(&ristretto.Config{
- NumCounters: 100000, // 10W
- MaxCost: 1024 * 1024 * 10, // 10MB
+ NumCounters: 800000,
+ MaxCost: 1000 * 1000 * 64,
BufferItems: 64,
})
diff --git a/kernel/sql/cache.go b/kernel/sql/cache.go
index 539c4a486c..6ca4f928b6 100644
--- a/kernel/sql/cache.go
+++ b/kernel/sql/cache.go
@@ -27,8 +27,8 @@ import (
)
var memCache, _ = ristretto.NewCache(&ristretto.Config{
- NumCounters: 100000, // 10W
- MaxCost: 1024 * 1024 * 10, // 10MB
+ NumCounters: 800000,
+ MaxCost: 1000 * 1000 * 100,
BufferItems: 64,
})
var disabled = true
@@ -110,9 +110,7 @@ func GetRefsCacheByDefID(defID string) (ret []*Ref) {
return
}
-var (
- defIDRefsCache = gcache.New(30*time.Minute, 5*time.Minute) // [defBlockID]map[refBlockID]*Ref
-)
+var defIDRefsCache = gcache.New(30*time.Minute, 5*time.Minute) // [defBlockID]map[refBlockID]*Ref
func CacheRef(tree *parse.Tree, refIDNode *ast.Node) {
ref := buildRef(tree, refIDNode)