Skip to content

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

:art: 虚拟引用关键字缓存调整为 10 分钟 Fix https://github.com/siyuan-note/siyuan/issues/6602

Liang Dingfee4811031e9
diff --git a/kernel/sql/cache.go b/kernel/sql/cache.go
index f9ecaddfdc..9b928d7266 100644
--- a/kernel/sql/cache.go
+++ b/kernel/sql/cache.go
@@ -70,11 +70,18 @@ func removeBlockCache(id string) {
removeRefCacheByDefID(id)
}
+var virtualRefKeywordsCacheTime = time.Now()
+
func getVirtualRefKeywordsCache() ([]string, bool) {
if disabled {
return nil, false
}
+ if 10 < time.Now().Sub(virtualRefKeywordsCacheTime).Minutes() {
+ ClearVirtualRefKeywords()
+ return nil, false
+ }
+
if val, ok := memCache.Get("virtual_ref"); ok {
return val.([]string), true
}