Fix stale context for bucket retrieval (#10551)

The provided context gets captured by the closure making all subsequent calls fail.
master
Klaus Post 4 years ago committed by GitHub
parent 0537a21b79
commit eec69d6796
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/bucket-quota.go

@ -71,6 +71,8 @@ func (sys *BucketQuotaSys) check(ctx context.Context, bucket string, size int64)
sys.bucketStorageCache.Once.Do(func() {
sys.bucketStorageCache.TTL = 1 * time.Second
sys.bucketStorageCache.Update = func() (interface{}, error) {
ctx, done := context.WithTimeout(context.Background(), 5*time.Second)
defer done()
return loadDataUsageFromBackend(ctx, objAPI)
}
})

Loading…
Cancel
Save