mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
perf: Only remove generated data when no bucket name specified (#16610)
This commit is contained in:
parent
fb17f97cf3
commit
6efe4d1df6
@ -1217,6 +1217,7 @@ func (a adminAPIHandlers) ObjectSpeedTestHandler(w http.ResponseWriter, r *http.
|
|||||||
storageClass := strings.TrimSpace(r.Form.Get(peerRESTStorageClass))
|
storageClass := strings.TrimSpace(r.Form.Get(peerRESTStorageClass))
|
||||||
customBucket := strings.TrimSpace(r.Form.Get(peerRESTBucket))
|
customBucket := strings.TrimSpace(r.Form.Get(peerRESTBucket))
|
||||||
autotune := r.Form.Get("autotune") == "true"
|
autotune := r.Form.Get("autotune") == "true"
|
||||||
|
noClear := r.Form.Get("noclear") == "true"
|
||||||
|
|
||||||
size, err := strconv.Atoi(sizeStr)
|
size, err := strconv.Atoi(sizeStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1258,14 +1259,16 @@ func (a adminAPIHandlers) ObjectSpeedTestHandler(w http.ResponseWriter, r *http.
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !bucketExists {
|
if !noClear && !bucketExists {
|
||||||
defer deleteObjectPerfBucket(objectAPI)
|
defer deleteObjectPerfBucket(objectAPI)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defer objectAPI.DeleteObject(ctx, customBucket, speedTest+SlashSeparator, ObjectOptions{
|
if !noClear {
|
||||||
DeletePrefix: true,
|
defer objectAPI.DeleteObject(ctx, customBucket, speedTest+SlashSeparator, ObjectOptions{
|
||||||
})
|
DeletePrefix: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Freeze all incoming S3 API calls before running speedtest.
|
// Freeze all incoming S3 API calls before running speedtest.
|
||||||
globalNotificationSys.ServiceFreeze(ctx, true)
|
globalNotificationSys.ServiceFreeze(ctx, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user