♻️ Remove bazaar cache clear on appearance language change (#17160)

This commit is contained in:
Jeffrey Chen 2026-03-08 15:13:43 +08:00 committed by GitHub
parent c564905afa
commit 465755e184
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 12 deletions

View file

@ -23,7 +23,6 @@ import (
"github.com/88250/gulu"
"github.com/gin-gonic/gin"
"github.com/siyuan-note/siyuan/kernel/bazaar"
"github.com/siyuan-note/siyuan/kernel/conf"
"github.com/siyuan-note/siyuan/kernel/model"
"github.com/siyuan-note/siyuan/kernel/server/proxy"
@ -554,16 +553,10 @@ func setAppearance(c *gin.Context) {
model.Conf.Appearance = appearance
util.StatusBarCfg = model.Conf.Appearance.StatusBar
model.Conf.Lang = appearance.Lang
oldLang := util.Lang
util.Lang = model.Conf.Lang
model.Conf.Save()
model.InitAppearance()
if oldLang != util.Lang {
// The marketplace language does not change after switching the appearance language https://github.com/siyuan-note/siyuan/issues/12892
bazaar.CleanBazaarPackageCache()
}
ret.Data = model.Conf.Appearance
util.BroadcastByType("main", "setAppearance", 0, "", model.Conf.Appearance)
}

View file

@ -35,11 +35,6 @@ import (
// packageInstallSizeCache 缓存集市包的安装大小,与 cachedStageIndex 使用相同的缓存时间
var packageInstallSizeCache = gcache.New(time.Duration(util.RhyCacheDuration)*time.Second, time.Duration(util.RhyCacheDuration)*time.Second/6) // [repoURL]*int64
// CleanBazaarPackageCache 清空集市包相关缓存(如切换语言后需刷新展示名等)
func CleanBazaarPackageCache() {
packageInstallSizeCache.Flush()
}
// ReadInstalledPackageDirs 读取本地集市包的目录列表
func ReadInstalledPackageDirs(basePath string) ([]os.DirEntry, error) {
if !util.IsPathRegularDirOrSymlinkDir(basePath) {