feat(botfilter): add newClientCache
This commit is contained in:
1 parent
1160d7c591
commit
598618c00a
1 file changed
+13
@@ -49,3 +49,16 @@ type clientCache struct {
|
||||
operations uint64
|
||||
}
|
||||
|
||||
func newClientCache(cfg *compiledConfig) *clientCache {
|
||||
return &clientCache{
|
||||
entries: make(map[string]*clientState),
|
||||
maxEntries: cfg.MaxTrackedIPs,
|
||||
maxEvents: cfg.MaxScoreEventsPerIP,
|
||||
scoreWindow: cfg.scoreWindow,
|
||||
banDuration: cfg.banDuration,
|
||||
threshold: cfg.ScoreThreshold,
|
||||
randomPaths: append([]string(nil), cfg.randomPaths...),
|
||||
randomScore: cfg.RandomArticleScore,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user