调整一些默认配置

This commit is contained in:
starry
2025-09-02 01:03:50 +08:00
committed by GitHub
parent 0cd5a7334d
commit 45b4acc31f
2 changed files with 4 additions and 4 deletions

View File

@@ -84,8 +84,8 @@ func DefaultConfig() *AppConfig {
RequestLimit int `toml:"requestLimit"`
PeriodHours float64 `toml:"periodHours"`
}{
RequestLimit: 200,
PeriodHours: 1.0,
RequestLimit: 500,
PeriodHours: 3.0,
},
Security: struct {
WhiteList []string `toml:"whiteList"`

View File

@@ -13,7 +13,7 @@ import (
)
const (
CleanupInterval = 10 * time.Minute
CleanupInterval = 20 * time.Minute
MaxIPCacheSize = 10000
)
@@ -98,7 +98,7 @@ func (i *IPRateLimiter) cleanupRoutine() {
i.mu.RLock()
for ip, entry := range i.ips {
if now.Sub(entry.lastAccess) > 1*time.Hour {
if now.Sub(entry.lastAccess) > 2*time.Hour {
expired = append(expired, ip)
}
}