choose smaller default deadline for diagnostics without --full (#14599)

This commit is contained in:
Harshavardhana 2022-03-21 23:25:24 -07:00 committed by GitHub
parent 751e9fb7be
commit d796621ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015-2021 MinIO, Inc. // Copyright (c) 2015-2022 MinIO, Inc.
// //
// This file is part of MinIO Object Storage stack // This file is part of MinIO Object Storage stack
// //
@ -1684,7 +1684,10 @@ func (a adminAPIHandlers) HealthInfoHandler(w http.ResponseWriter, r *http.Reque
logger.LogIf(ctx, enc.Encode(healthInfo)) logger.LogIf(ctx, enc.Encode(healthInfo))
} }
deadline := 1 * time.Hour deadline := 10 * time.Second // Default deadline is 10secs for health diagnostics.
if query.Get("perfnet") != "" || query.Get("perfdrive") != "" {
deadline = 1 * time.Hour
}
if dstr := r.Form.Get("deadline"); dstr != "" { if dstr := r.Form.Get("deadline"); dstr != "" {
var err error var err error
deadline, err = time.ParseDuration(dstr) deadline, err = time.ParseDuration(dstr)