only look for valid buckets (#19244)

fixes #19239
This commit is contained in:
Harshavardhana 2024-03-12 04:33:30 -07:00 committed by GitHub
parent b4a23f720e
commit 81d7531f1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,8 +296,8 @@ func collectAPIStats(api string, f http.HandlerFunc) http.HandlerFunc {
bucket, _ := path2BucketObject(resource)
_, err = globalBucketMetadataSys.Get(bucket) // check if this bucket exists.
countBktStat := bucket != "" && bucket != minioReservedBucket && err == nil
meta, err := globalBucketMetadataSys.Get(bucket) // check if this bucket exists.
countBktStat := bucket != "" && bucket != minioReservedBucket && err == nil && !meta.Created.IsZero()
if countBktStat {
globalBucketHTTPStats.updateHTTPStats(bucket, api, nil)
}