X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/afb710394b65fc82da8e4edd024a3a5fc1a18d54..ec0c244be178aed7af0cf990a256dda557034b68:/services/keep-web/cache.go diff --git a/services/keep-web/cache.go b/services/keep-web/cache.go index c29ae7d43c..ce1168acd2 100644 --- a/services/keep-web/cache.go +++ b/services/keep-web/cache.go @@ -16,6 +16,7 @@ import ( type cache struct { TTL arvados.Duration + UUIDTTL arvados.Duration MaxCollectionEntries int MaxCollectionBytes int64 MaxPermissionEntries int @@ -135,13 +136,12 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo return nil, err } if current.PortableDataHash == pdh { - exp := time.Now().Add(time.Duration(c.TTL)) c.permissions.Add(permKey, &cachedPermission{ - expire: exp, + expire: time.Now().Add(time.Duration(c.TTL)), }) if pdh != targetID { c.pdhs.Add(targetID, &cachedPDH{ - expire: exp, + expire: time.Now().Add(time.Duration(c.UUIDTTL)), pdh: pdh, }) } @@ -167,7 +167,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo expire: exp, }) c.pdhs.Add(targetID, &cachedPDH{ - expire: exp, + expire: time.Now().Add(time.Duration(c.UUIDTTL)), pdh: collection.PortableDataHash, }) c.collections.Add(arv.ApiToken+"\000"+collection.PortableDataHash, &cachedCollection{