⬆️ Upgrade kernel deps

This commit is contained in:
Daniel 2024-09-22 10:41:11 +08:00
parent 0aaa4299d7
commit c765bcc36f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
5 changed files with 12 additions and 12 deletions

8
kernel/cache/ial.go vendored
View file

@ -23,7 +23,7 @@ import (
"github.com/dgraph-io/ristretto" "github.com/dgraph-io/ristretto"
) )
var docIALCache, _ = ristretto.NewCache(&ristretto.Config{ var docIALCache, _ = ristretto.NewCache[string, map[string]string](&ristretto.Config[string, map[string]string]{
NumCounters: 1024 * 100, NumCounters: 1024 * 100,
MaxCost: 1024 * 1024 * 200, MaxCost: 1024 * 1024 * 200,
BufferItems: 64, BufferItems: 64,
@ -40,7 +40,7 @@ func GetDocIAL(p string) (ret map[string]string) {
} }
ret = map[string]string{} ret = map[string]string{}
for k, v := range ial.(map[string]string) { for k, v := range ial {
ret[k] = strings.ReplaceAll(v, editor.IALValEscNewLine, "\n") ret[k] = strings.ReplaceAll(v, editor.IALValEscNewLine, "\n")
} }
return return
@ -54,7 +54,7 @@ func ClearDocsIAL() {
docIALCache.Clear() docIALCache.Clear()
} }
var blockIALCache, _ = ristretto.NewCache(&ristretto.Config{ var blockIALCache, _ = ristretto.NewCache[string, map[string]string](&ristretto.Config[string, map[string]string]{
NumCounters: 1024 * 1000, NumCounters: 1024 * 1000,
MaxCost: 1024 * 1024 * 200, MaxCost: 1024 * 1024 * 200,
BufferItems: 64, BufferItems: 64,
@ -69,7 +69,7 @@ func GetBlockIAL(id string) (ret map[string]string) {
if nil == ial { if nil == ial {
return return
} }
return ial.(map[string]string) return ial
} }
func RemoveBlockIAL(id string) { func RemoveBlockIAL(id string) {

View file

@ -54,7 +54,7 @@ require (
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
github.com/sashabaranov/go-openai v1.29.1 github.com/sashabaranov/go-openai v1.29.1
github.com/shirou/gopsutil/v3 v3.24.5 github.com/shirou/gopsutil/v3 v3.24.5
github.com/siyuan-note/dejavu v0.0.0-20240922022610-033cc35db309 github.com/siyuan-note/dejavu v0.0.0-20240922023411-ba02dd7afac9
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4
github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97 github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97
github.com/siyuan-note/filelock v0.0.0-20240724034355-d1ed7bf21d04 github.com/siyuan-note/filelock v0.0.0-20240724034355-d1ed7bf21d04

View file

@ -332,8 +332,8 @@ github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+D
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA= github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA=
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8= github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
github.com/siyuan-note/dejavu v0.0.0-20240922022610-033cc35db309 h1:jo6rn0qK4YEXlRvNrZzHC/zdOErCNh61ad57EO8O0ow= github.com/siyuan-note/dejavu v0.0.0-20240922023411-ba02dd7afac9 h1:TRIWGA/sP4T2eAEJSNpNhct8iGHDIGyXEtSnq2FYnwQ=
github.com/siyuan-note/dejavu v0.0.0-20240922022610-033cc35db309/go.mod h1:3Hl2ttBIdfRMhzJ+WEvbuYokL3JLSMj8jObn96hrWt4= github.com/siyuan-note/dejavu v0.0.0-20240922023411-ba02dd7afac9/go.mod h1:3Hl2ttBIdfRMhzJ+WEvbuYokL3JLSMj8jObn96hrWt4=
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 h1:kJaw5L/evyW6LcB9IQT8PR4ppx8JVqOFP9Ix3rfwSrc= github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 h1:kJaw5L/evyW6LcB9IQT8PR4ppx8JVqOFP9Ix3rfwSrc=
github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4/go.mod h1:UYcCCY+0wh+GmUoDOaO63j1sV5lgy7laLAk1XhEiUis= github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4/go.mod h1:UYcCCY+0wh+GmUoDOaO63j1sV5lgy7laLAk1XhEiUis=
github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97 h1:lM5v8BfNtbOL5jYwhCdMYBcYtr06IYBKjjSLAPMKTM8= github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97 h1:lM5v8BfNtbOL5jYwhCdMYBcYtr06IYBKjjSLAPMKTM8=

View file

@ -37,7 +37,7 @@ import (
// virtualBlockRefCache 用于保存块关联的虚拟引用关键字。 // virtualBlockRefCache 用于保存块关联的虚拟引用关键字。
// 改进打开虚拟引用后加载文档的性能 https://github.com/siyuan-note/siyuan/issues/7378 // 改进打开虚拟引用后加载文档的性能 https://github.com/siyuan-note/siyuan/issues/7378
var virtualBlockRefCache, _ = ristretto.NewCache(&ristretto.Config{ var virtualBlockRefCache, _ = ristretto.NewCache[string, []string](&ristretto.Config[string, []string]{
NumCounters: 102400, NumCounters: 102400,
MaxCost: 10240, MaxCost: 10240,
BufferItems: 64, BufferItems: 64,
@ -60,7 +60,7 @@ func getBlockVirtualRefKeywords(root *ast.Node) (ret []string) {
ret = putBlockVirtualRefKeywords(content, root) ret = putBlockVirtualRefKeywords(content, root)
return return
} }
ret = val.([]string) ret = val
return return
} }
@ -216,7 +216,7 @@ func getVirtualRefKeywords(root *ast.Node) (ret []string) {
} }
if val, ok := virtualBlockRefCache.Get("virtual_ref"); ok { if val, ok := virtualBlockRefCache.Get("virtual_ref"); ok {
ret = val.([]string) ret = val
} }
if "" != strings.TrimSpace(Conf.Editor.VirtualBlockRefInclude) { if "" != strings.TrimSpace(Conf.Editor.VirtualBlockRefInclude) {

View file

@ -37,7 +37,7 @@ func disableCache() {
cacheDisabled = true cacheDisabled = true
} }
var blockCache, _ = ristretto.NewCache(&ristretto.Config{ var blockCache, _ = ristretto.NewCache[string, *Block](&ristretto.Config[string, *Block]{
NumCounters: 102400, NumCounters: 102400,
MaxCost: 10240, MaxCost: 10240,
BufferItems: 64, BufferItems: 64,
@ -67,7 +67,7 @@ func getBlockCache(id string) (ret *Block) {
b, _ := blockCache.Get(id) b, _ := blockCache.Get(id)
if nil != b { if nil != b {
ret = b.(*Block) ret = b
} }
return return
} }