Refactor cache and disable go-chi cache (#30417)

use built-in cache package to wrap external go-chi cache package
This commit is contained in:
wxiaoguang
2024-04-13 16:38:44 +08:00
committed by GitHub
parent 8fd8978b49
commit c248f010ad
15 changed files with 198 additions and 209 deletions

View File

@ -34,7 +34,7 @@ type commitStatusCacheValue struct {
func getCommitStatusCache(repoID int64, branchName string) *commitStatusCacheValue {
c := cache.GetCache()
statusStr, ok := c.Get(getCacheKey(repoID, branchName)).(string)
statusStr, ok := c.Get(getCacheKey(repoID, branchName))
if ok && statusStr != "" {
var cv commitStatusCacheValue
err := json.Unmarshal([]byte(statusStr), &cv)