调整一些默认配置
This commit is contained in:
@@ -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"`
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user