mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 虚拟引用关键字缓存调整为 10 分钟 Fix https://github.com/siyuan-note/siyuan/issues/6602
This commit is contained in:
parent
fcf7856431
commit
fee4811031
1 changed files with 7 additions and 0 deletions
|
|
@ -70,11 +70,18 @@ func removeBlockCache(id string) {
|
||||||
removeRefCacheByDefID(id)
|
removeRefCacheByDefID(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var virtualRefKeywordsCacheTime = time.Now()
|
||||||
|
|
||||||
func getVirtualRefKeywordsCache() ([]string, bool) {
|
func getVirtualRefKeywordsCache() ([]string, bool) {
|
||||||
if disabled {
|
if disabled {
|
||||||
return nil, false
|
return nil, false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 10 < time.Now().Sub(virtualRefKeywordsCacheTime).Minutes() {
|
||||||
|
ClearVirtualRefKeywords()
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
|
||||||
if val, ok := memCache.Get("virtual_ref"); ok {
|
if val, ok := memCache.Get("virtual_ref"); ok {
|
||||||
return val.([]string), true
|
return val.([]string), true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue