mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-21 11:30:42 +08:00
🎨 虚拟引用关键字缓存调整为 10 分钟 Fix https://github.com/siyuan-note/siyuan/issues/6602
This commit is contained in:
parent
fcf7856431
commit
fee4811031
@ -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…
Reference in New Issue
Block a user