🎨 虚拟引用 10 分钟缓存过期

This commit is contained in:
Liang Ding 2023-02-17 09:35:02 +08:00
parent f581b34ea8
commit 7ee231f134
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -21,6 +21,7 @@ import (
"regexp"
"sort"
"strings"
"time"
"github.com/88250/gulu"
"github.com/88250/lute"
@ -87,7 +88,7 @@ func putBlockVirtualRefKeywords(blockContent, blockID, docTitle string) (ret []s
}
ret = gulu.Str.RemoveDuplicatedElem(ret)
virtualBlockRefCache.Set(blockID, ret, 1)
virtualBlockRefCache.SetWithTTL(blockID, ret, 1, 10*time.Minute)
return
}