in cache build ranges metadata as needed (#9698)

master
Erkki Eilonen 5 years ago committed by GitHub
parent 1868c7016d
commit 301de169e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      cmd/disk-cache-backend.go

@ -498,10 +498,14 @@ func (c *diskCache) saveMetadata(ctx context.Context, bucket, object string, met
}
// increment hits
if rs != nil {
// rsFileName gets set by putRange. Check for blank values here
// coming from other code paths that set rs only (eg initial creation or hit increment).
if rsFileName != "" {
if m.Ranges == nil {
m.Ranges = make(map[string]string)
}
m.Ranges[rs.String(actualSize)] = rsFileName
}
} else {
// this is necessary cleanup of range files if entire object is cached.
for _, f := range m.Ranges {

Loading…
Cancel
Save