mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-23 16:56:10 +01:00
🐛 插入/更新资源文件导致内核崩溃 https://github.com/siyuan-note/siyuan/issues/5574
This commit is contained in:
parent
c0df1e50d4
commit
caf2dc5231
6 changed files with 19 additions and 16 deletions
|
|
@ -167,10 +167,9 @@ func SearchAssetsByName(keyword string) (ret []*cache.Asset) {
|
|||
ret = []*cache.Asset{}
|
||||
|
||||
count := 0
|
||||
cache.Assets.Range(func(k, v interface{}) bool {
|
||||
asset := v.(*cache.Asset)
|
||||
for _, asset := range cache.Assets {
|
||||
if !strings.Contains(strings.ToLower(asset.HName), strings.ToLower(keyword)) {
|
||||
return true
|
||||
continue
|
||||
}
|
||||
|
||||
_, hName := search.MarkText(asset.HName, keyword, 64, Conf.Search.CaseSensitive)
|
||||
|
|
@ -181,10 +180,9 @@ func SearchAssetsByName(keyword string) (ret []*cache.Asset) {
|
|||
})
|
||||
count++
|
||||
if Conf.Search.Limit <= count {
|
||||
return false
|
||||
return
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
sort.Slice(ret, func(i, j int) bool {
|
||||
return ret[i].Updated > ret[j].Updated
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue