mirror of
https://github.com/simon987/Architeuthis.git
synced 2025-12-20 03:25:57 +00:00
Config glob & hierarchy, fixes
This commit is contained in:
11
gc.go
11
gc.go
@@ -37,7 +37,7 @@ func (b *Balancer) cleanAllExpiredLimits() {
|
||||
|
||||
func cleanExpiredLimits(proxy *Proxy) {
|
||||
|
||||
const ttl = time.Second
|
||||
const ttl = time.Hour
|
||||
|
||||
limits := make(map[string]*ExpiringLimiter, 0)
|
||||
now := time.Now()
|
||||
@@ -60,6 +60,11 @@ func cleanExpiredLimits(proxy *Proxy) {
|
||||
func shouldPruneLimiter(host string) bool {
|
||||
|
||||
// Don't remove hosts that are coming from the config
|
||||
_, ok := config.Hosts[host]
|
||||
return !ok
|
||||
for _, conf := range config.Hosts {
|
||||
if conf.Host == host {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user