if pdh == "" {
// UUID->PDH mapping is not cached, might as well get
// the whole collection record and be done (below).
if pdh == "" {
// UUID->PDH mapping is not cached, might as well get
// the whole collection record and be done (below).
} else if cached := c.lookupCollection(arv.ApiToken + "\000" + pdh); cached == nil {
// PDH->manifest is not cached, might as well get the
// whole collection record (below).
} else if cached := c.lookupCollection(arv.ApiToken + "\000" + pdh); cached == nil {
// PDH->manifest is not cached, might as well get the
// whole collection record (below).
} else if !pdhRefresh {
// We looked up UUID->PDH very recently, and we still
// have the manifest for that PDH.
} else if !pdhRefresh {
// We looked up UUID->PDH very recently, and we still
// have the manifest for that PDH.
if current.PortableDataHash == pdh {
// PDH has not changed, cached manifest is
// correct.
if current.PortableDataHash == pdh {
// PDH has not changed, cached manifest is
// correct.
}
if cached := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); cached != nil {
// PDH changed, and we already have the
// manifest for that new PDH.
}
if cached := c.lookupCollection(arv.ApiToken + "\000" + current.PortableDataHash); cached != nil {
// PDH changed, and we already have the
// manifest for that new PDH.
exp := time.Now().Add(time.Duration(c.config.TTL))
if targetID != retrieved.PortableDataHash {
c.pdhs.Add(targetID, &cachedPDH{
exp := time.Now().Add(time.Duration(c.config.TTL))
if targetID != retrieved.PortableDataHash {
c.pdhs.Add(targetID, &cachedPDH{