Merge branch '11917-dont-clear-cache'
[arvados.git] / services / keep-web / cache.go
index 2dfb542cf1d7033c068249a6b18be062ba086f0c..d72effc075d65a62d41b722ec177dfa3d465ec5f 100644 (file)
@@ -1,3 +1,7 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
 package main
 
 import (
@@ -102,7 +106,6 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
        var pdh string
        if arvadosclient.PDHMatch(targetID) {
                pdh = targetID
-       } else if forceReload {
        } else if ent, cached := c.pdhs.Get(targetID); cached {
                ent := ent.(*cachedPDH)
                if ent.expire.Before(time.Now()) {
@@ -167,13 +170,14 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
                expire: exp,
                pdh:    collection.PortableDataHash,
        })
-       c.collections.Add(collection.PortableDataHash, &cachedCollection{
-               expire:     exp,
-               collection: collection,
-       })
-       if int64(len(collection.ManifestText)) > c.MaxCollectionBytes/int64(c.MaxCollectionEntries) {
-               go c.pruneCollections()
-       }
+       // Disabled, see #11945
+       // c.collections.Add(collection.PortableDataHash, &cachedCollection{
+       //      expire:     exp,
+       //      collection: collection,
+       // })
+       // if int64(len(collection.ManifestText)) > c.MaxCollectionBytes/int64(c.MaxCollectionEntries) {
+       //      go c.pruneCollections()
+       // }
        return collection, nil
 }