Skip to content

Commit e823c13

Browse files
committed
fix: 更新缓存设置中的 AlistTTL 为 AlistAPITTL,以反映新的配置字段
1 parent bd67960 commit e823c13

3 files changed

Lines changed: 3 additions & 4 deletions

File tree

internal/config/type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type BaseLoggerSetting struct {
3838
type CacheSetting struct {
3939
Enable bool `yaml:"enable"`
4040
HTTPStrmTTL time.Duration `yaml:"http_strm_ttl"`
41-
AlistTTL time.Duration `yaml:"alist_ttl"`
41+
AlistAPITTL time.Duration `yaml:"alist_api_ttl"`
4242
}
4343

4444
// Web前端自定义设置

internal/middleware/fliter.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ func ClientFilter() gin.HandlerFunc {
3737
}
3838
}
3939
}
40-
4140
if !allowed {
4241
ctx.AbortWithStatus(http.StatusForbidden) // 禁止访问
4342
logging.Info("客户端过滤器拦截了请求,User-Agent: ", userAgent)

internal/service/alist/alist.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func New(addr string, username string, password string, token *string) *AlistSer
4444
expireAt: time.Time{},
4545
}
4646
}
47-
if config.Cache.Enable && config.Cache.AlistTTL > 0 {
48-
cache, err := bigcache.NewBigCache(bigcache.DefaultConfig(config.Cache.AlistTTL))
47+
if config.Cache.Enable && config.Cache.AlistAPITTL > 0 {
48+
cache, err := bigcache.NewBigCache(bigcache.DefaultConfig(config.Cache.AlistAPITTL))
4949
if err == nil {
5050
s.cache = cache
5151
} else {

0 commit comments

Comments
 (0)