[arvados] updated: 2.4.2-29-g2a2c7bdbf
git repository hosting
git at public.arvados.org
Tue Sep 20 13:27:03 UTC 2022
Summary of changes:
services/keep-web/cache.go | 8 ++++++++
1 file changed, 8 insertions(+)
via 2a2c7bdbfdfcf72abb9940032711c22111e48870 (commit)
from 991940e9924c33a08a6cf57142873fd45732b1d2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 2a2c7bdbfdfcf72abb9940032711c22111e48870
Author: Tom Clegg <tom at curii.com>
Date: Tue Sep 20 09:25:47 2022 -0400
19502: Fix mtime for cached collections.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/services/keep-web/cache.go b/services/keep-web/cache.go
index 25b113671..f585a63a4 100644
--- a/services/keep-web/cache.go
+++ b/services/keep-web/cache.go
@@ -116,6 +116,7 @@ type cachedPDH struct {
expire time.Time
refresh time.Time
pdh string
+ mtime time.Time
}
type cachedCollection struct {
@@ -214,6 +215,7 @@ func (c *cache) Update(client *arvados.Client, coll arvados.Collection, fs arvad
expire: time.Now().Add(time.Duration(c.config.TTL)),
refresh: time.Now().Add(time.Duration(c.config.UUIDTTL)),
pdh: updated.PortableDataHash,
+ mtime: updated.ModifiedAt,
})
return nil
}
@@ -309,6 +311,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
var pdhRefresh bool
var pdh string
+ var mtime time.Time
if arvadosclient.PDHMatch(targetID) {
pdh = targetID
} else if ent, cached := c.pdhs.Get(targetID); cached {
@@ -317,6 +320,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
c.pdhs.Remove(targetID)
} else {
pdh = ent.pdh
+ mtime = ent.mtime
pdhRefresh = forceReload || time.Now().After(ent.refresh)
c.metrics.pdhHits.Inc()
}
@@ -338,6 +342,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
UUID: targetID,
ManifestText: cached.ManifestText,
PortableDataHash: pdh,
+ ModifiedAt: mtime,
}, nil
} else {
// Get current PDH for this UUID (and confirm we still
@@ -358,6 +363,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
UUID: targetID,
ManifestText: cached.ManifestText,
PortableDataHash: pdh,
+ ModifiedAt: current.ModifiedAt,
}, nil
}
if cached := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); cached != nil {
@@ -368,6 +374,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
UUID: targetID,
ManifestText: cached.ManifestText,
PortableDataHash: current.PortableDataHash,
+ ModifiedAt: current.ModifiedAt,
}, nil
}
}
@@ -387,6 +394,7 @@ func (c *cache) Get(arv *arvadosclient.ArvadosClient, targetID string, forceRelo
expire: exp,
refresh: time.Now().Add(time.Duration(c.config.UUIDTTL)),
pdh: retrieved.PortableDataHash,
+ mtime: retrieved.ModifiedAt,
})
}
c.collections.Add(arv.ApiToken+"\000"+retrieved.PortableDataHash, &cachedCollection{
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list