清理内容

This commit is contained in:
ExplodingDragon
2025-11-21 00:00:49 +08:00
parent 651433ff82
commit 58d0234003
4 changed files with 6 additions and 5 deletions

View File

@@ -102,7 +102,7 @@ func (c *ProviderCache) Open(ctx context.Context, owner, repo, commit, path stri
return nil, os.ErrNotExist
} else if lastCache != nil {
h := lastCache.Metadata
if h["_404_"] == "true" {
if h["404"] == "true" {
return nil, os.ErrNotExist
}
respHeader := make(http.Header)
@@ -133,7 +133,7 @@ func (c *ProviderCache) Open(ctx context.Context, owner, repo, commit, path stri
// 当上游返回错误时缓存404结果
if errors.Is(err, os.ErrNotExist) {
if err = c.cacheBlob.Put(ctx, key, map[string]string{
"_404_": "true",
"404": "true",
}, bytes.NewBuffer(nil), time.Hour); err != nil {
zap.L().Warn("缓存404失败", zap.Error(err))
}
@@ -143,7 +143,7 @@ func (c *ProviderCache) Open(ctx context.Context, owner, repo, commit, path stri
if open.StatusCode == http.StatusNotFound {
// 缓存404路由
if err = c.cacheBlob.Put(ctx, key, map[string]string{
"_404_": "true",
"404": "true",
}, bytes.NewBuffer(nil), time.Hour); err != nil {
zap.L().Warn("缓存404失败", zap.Error(err))
}