Skip to content

Commit

Permalink
add cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiang-Red committed Aug 21, 2024
1 parent be4e7d4 commit 10a35ac
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions control/servicepic.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type plugininfo struct {
}

var (
// serverlistlogo 缓存
serverlistlogo image.Image
// 字体 GlowSans 数据
glowsd []byte
// 字体 Impact 数据
Expand Down Expand Up @@ -82,9 +84,11 @@ func renderservepicof(gid int64) (img image.Image, err error) {
if err != nil {
return
}
serverlistlogo, err := renderserverlistlogo()
if err != nil {
return
if serverlistlogo == nil {
serverlistlogo, err = renderserverlistlogo()
if err != nil {
return
}
}
listnum := len(pluginlist)
ln := math.Ceil(listnum, 3)
Expand Down

0 comments on commit 10a35ac

Please sign in to comment.