diff options
author | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-10-30 16:13:42 +0300 |
---|---|---|
committer | feistel <6742251-feistel@users.noreply.gitlab.com> | 2021-10-30 16:13:42 +0300 |
commit | 94465c8fbbcc08ecceab7a0990d06445b7e561ea (patch) | |
tree | b856f9fb816e0b77518309fa757f7764ea2f8736 /internal | |
parent | 8c051f99dd86ad424b7e3c28ca82297847c4e08c (diff) |
refactor: decouple client object from memstore
Diffstat (limited to 'internal')
-rw-r--r-- | internal/source/gitlab/cache/cache.go | 2 | ||||
-rw-r--r-- | internal/source/gitlab/cache/memstore.go | 3 |
2 files changed, 2 insertions, 3 deletions
diff --git a/internal/source/gitlab/cache/cache.go b/internal/source/gitlab/cache/cache.go index c33765f5..7a81b3af 100644 --- a/internal/source/gitlab/cache/cache.go +++ b/internal/source/gitlab/cache/cache.go @@ -19,7 +19,7 @@ type Cache struct { func NewCache(client api.Client, cc *config.Cache) *Cache { r := NewRetriever(client, cc.RetrievalTimeout, cc.MaxRetrievalInterval, cc.MaxRetrievalRetries) return &Cache{ - store: newMemStore(client, cc), + store: newMemStore(cc), retriever: r, } } diff --git a/internal/source/gitlab/cache/memstore.go b/internal/source/gitlab/cache/memstore.go index 40661ce9..721a2b0a 100644 --- a/internal/source/gitlab/cache/memstore.go +++ b/internal/source/gitlab/cache/memstore.go @@ -7,7 +7,6 @@ import ( "github.com/patrickmn/go-cache" "gitlab.com/gitlab-org/gitlab-pages/internal/config" - "gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/api" ) type memstore struct { @@ -17,7 +16,7 @@ type memstore struct { entryExpirationTimeout time.Duration } -func newMemStore(client api.Client, cc *config.Cache) Store { +func newMemStore(cc *config.Cache) Store { return &memstore{ store: cache.New(cc.CacheExpiry, cc.CacheCleanupInterval), mux: &sync.RWMutex{}, |