Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-12-01 02:04:01 +0300
committerfeistel <6742251-feistel@users.noreply.gitlab.com>2021-12-01 02:04:01 +0300
commit9edffc543f407a709afd3fae229360b30f6c0d63 (patch)
tree1a3bd8036982b55be43b7c61ee7d08a3a4d6c799 /internal
parentb0dc301ecb87b7ee3b3fe7680c326a266c930a9c (diff)
refactor: rename func and const to ensure
make sure we're not spilling implementation details from the ratelimites package
Diffstat (limited to 'internal')
-rw-r--r--internal/lru/lru.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/lru/lru.go b/internal/lru/lru.go
index 741d9ad2..8c467ba5 100644
--- a/internal/lru/lru.go
+++ b/internal/lru/lru.go
@@ -19,8 +19,8 @@ const itemsToPruneDiv = 16
// based on an avg ~4,000 unique IPs per minute
// https://log.gprd.gitlab.net/app/lens#/edit/f7110d00-2013-11ec-8c8e-ed83b5469915?_g=h@e78830b
-const defaultSourceIPItems = 5000
-const defaultSourceIPExpirationInterval = time.Minute
+const defaultCacheMaxSize = 1000
+const defaultCacheExpirationInterval = time.Minute
// Option function to configure a Cache
type Option func(*Cache)
@@ -106,13 +106,13 @@ func WithCachedRequestsMetric(m *prometheus.CounterVec) Option {
}
}
-func WithSourceIPExpirationInterval(t time.Duration) Option {
+func WithExpirationInterval(t time.Duration) Option {
return func(c *Cache) {
c.duration = t
}
}
-func WithSourceIPItems(i int64) Option {
+func WithMaxSize(i int64) Option {
return func(c *Cache) {
c.maxSize = i
}