mirror of https://github.com/minio/minio.git
parent
d300e775a6
commit
3d7c1ad31d
|
@ -1069,11 +1069,7 @@ func (a adminAPIHandlers) AccountInfoHandler(w http.ResponseWriter, r *http.Requ
|
||||||
var err error
|
var err error
|
||||||
if !globalIsGateway {
|
if !globalIsGateway {
|
||||||
// Load the latest calculated data usage
|
// Load the latest calculated data usage
|
||||||
dataUsageInfo, err = loadDataUsageFromBackend(ctx, objectAPI)
|
dataUsageInfo, _ = loadDataUsageFromBackend(ctx, objectAPI)
|
||||||
if err != nil {
|
|
||||||
// log the error, continue with the accounting response
|
|
||||||
logger.LogIf(ctx, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If etcd, dns federation configured list buckets from etcd.
|
// If etcd, dns federation configured list buckets from etcd.
|
||||||
|
@ -1142,11 +1138,7 @@ func (a adminAPIHandlers) AccountInfoHandler(w http.ResponseWriter, r *http.Requ
|
||||||
// Fetch the prefix usage of the current bucket
|
// Fetch the prefix usage of the current bucket
|
||||||
var prefixUsage map[string]uint64
|
var prefixUsage map[string]uint64
|
||||||
if enablePrefixUsage {
|
if enablePrefixUsage {
|
||||||
if pu, err := loadPrefixUsageFromBackend(ctx, objectAPI, bucket.Name); err == nil {
|
prefixUsage, _ = loadPrefixUsageFromBackend(ctx, objectAPI, bucket.Name)
|
||||||
prefixUsage = pu
|
|
||||||
} else {
|
|
||||||
logger.LogIf(ctx, err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lcfg, _ := globalBucketObjectLockSys.Get(bucket.Name)
|
lcfg, _ := globalBucketObjectLockSys.Get(bucket.Name)
|
||||||
|
|
|
@ -19,6 +19,7 @@ package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
|
@ -90,7 +91,7 @@ func loadPrefixUsageFromBackend(ctx context.Context, objAPI ObjectLayer, bucket
|
||||||
func loadDataUsageFromBackend(ctx context.Context, objAPI ObjectLayer) (DataUsageInfo, error) {
|
func loadDataUsageFromBackend(ctx context.Context, objAPI ObjectLayer) (DataUsageInfo, error) {
|
||||||
buf, err := readConfig(ctx, objAPI, dataUsageObjNamePath)
|
buf, err := readConfig(ctx, objAPI, dataUsageObjNamePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if isErrObjectNotFound(err) || isErrBucketNotFound(err) {
|
if errors.Is(err, errConfigNotFound) {
|
||||||
return DataUsageInfo{}, nil
|
return DataUsageInfo{}, nil
|
||||||
}
|
}
|
||||||
return DataUsageInfo{}, toObjectErr(err, minioMetaBucket, dataUsageObjNamePath)
|
return DataUsageInfo{}, toObjectErr(err, minioMetaBucket, dataUsageObjNamePath)
|
||||||
|
|
Loading…
Reference in New Issue