调整一些默认配置
This commit is contained in:
@@ -84,8 +84,8 @@ func DefaultConfig() *AppConfig {
|
|||||||
RequestLimit int `toml:"requestLimit"`
|
RequestLimit int `toml:"requestLimit"`
|
||||||
PeriodHours float64 `toml:"periodHours"`
|
PeriodHours float64 `toml:"periodHours"`
|
||||||
}{
|
}{
|
||||||
RequestLimit: 200,
|
RequestLimit: 500,
|
||||||
PeriodHours: 1.0,
|
PeriodHours: 3.0,
|
||||||
},
|
},
|
||||||
Security: struct {
|
Security: struct {
|
||||||
WhiteList []string `toml:"whiteList"`
|
WhiteList []string `toml:"whiteList"`
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CleanupInterval = 10 * time.Minute
|
CleanupInterval = 20 * time.Minute
|
||||||
MaxIPCacheSize = 10000
|
MaxIPCacheSize = 10000
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ func (i *IPRateLimiter) cleanupRoutine() {
|
|||||||
|
|
||||||
i.mu.RLock()
|
i.mu.RLock()
|
||||||
for ip, entry := range i.ips {
|
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)
|
expired = append(expired, ip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user