diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-12-01 03:34:58 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-12-01 03:34:58 +0300 |
commit | d228c13c76d11091f8514e40940dc7df1b633e5a (patch) | |
tree | 866eb85df7764f775494d9f8a4db6792e022eed0 /internal/vfs | |
parent | e3c2565e7086a38f02dd5175e51dde187ce5457f (diff) | |
parent | 17c333c2a8de78c08dd070431652cc844fcc7b57 (diff) |
Merge branch 'refactor/limiter-new' into 'master'
refactor: make internal/lru and internal/ratelimiter metrics optional
Closes #647
See merge request gitlab-org/gitlab-pages!606
Diffstat (limited to 'internal/vfs')
-rw-r--r-- | internal/vfs/zip/vfs.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/vfs/zip/vfs.go b/internal/vfs/zip/vfs.go index 07afa691..a9825190 100644 --- a/internal/vfs/zip/vfs.go +++ b/internal/vfs/zip/vfs.go @@ -87,17 +87,17 @@ func New(cfg *config.ZipServing) vfs.VFS { // TODO: To be removed with https://gitlab.com/gitlab-org/gitlab-pages/-/issues/480 zipVFS.dataOffsetCache = lru.New( "data-offset", - defaultDataOffsetItems, - defaultDataOffsetExpirationInterval, - metrics.ZipCachedEntries, - metrics.ZipCacheRequests, + lru.WithMaxSize(defaultDataOffsetItems), + lru.WithExpirationInterval(defaultDataOffsetExpirationInterval), + lru.WithCachedEntriesMetric(metrics.ZipCachedEntries), + lru.WithCachedRequestsMetric(metrics.ZipCacheRequests), ) zipVFS.readlinkCache = lru.New( "readlink", - defaultReadlinkItems, - defaultReadlinkExpirationInterval, - metrics.ZipCachedEntries, - metrics.ZipCacheRequests, + lru.WithMaxSize(defaultReadlinkItems), + lru.WithExpirationInterval(defaultReadlinkExpirationInterval), + lru.WithCachedEntriesMetric(metrics.ZipCachedEntries), + lru.WithCachedRequestsMetric(metrics.ZipCacheRequests), ) return zipVFS |