[#223] node: Refactor cache usage
ci/woodpecker/pr/pre-commit Pipeline was successful Details
ci/woodpecker/push/pre-commit Pipeline was successful Details

Drop excess type args.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
pull/223/head
Dmitrii Stepanov 2023-04-06 16:24:43 +03:00
parent 93eba19a8e
commit 2c07f831c7
1 changed files with 2 additions and 2 deletions

View File

@ -130,7 +130,7 @@ type ttlContainerStorage struct {
func newCachedContainerStorage(v container.Source, ttl time.Duration) ttlContainerStorage {
const containerCacheSize = 100
lruCnrCache := newNetworkTTLCache[cid.ID, *container.Container](containerCacheSize, ttl, func(id cid.ID) (*container.Container, error) {
lruCnrCache := newNetworkTTLCache(containerCacheSize, ttl, func(id cid.ID) (*container.Container, error) {
return v.Get(id)
})
@ -340,7 +340,7 @@ func newCachedIRFetcher(f interface{ InnerRingKeys() ([][]byte, error) }) cached
irFetcherCacheTTL = 30 * time.Second
)
irFetcherCache := newNetworkTTLCache[struct{}, [][]byte](irFetcherCacheSize, irFetcherCacheTTL,
irFetcherCache := newNetworkTTLCache(irFetcherCacheSize, irFetcherCacheTTL,
func(_ struct{}) ([][]byte, error) {
return f.InnerRingKeys()
},