mirror of
https://github.com/minio/minio.git
synced 2025-11-28 13:09:09 -05:00
Add madmin package context support (#9172)
This is to improve responsiveness for all admin API operations and allowing callers to cancel any on-going admin operations, if they happen to be waiting too long.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
package madmin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -45,7 +46,7 @@ type HelpKV struct {
|
||||
type HelpKVS []HelpKV
|
||||
|
||||
// HelpConfigKV - return help for a given sub-system.
|
||||
func (adm *AdminClient) HelpConfigKV(subSys, key string, envOnly bool) (Help, error) {
|
||||
func (adm *AdminClient) HelpConfigKV(ctx context.Context, subSys, key string, envOnly bool) (Help, error) {
|
||||
v := url.Values{}
|
||||
v.Set("subSys", subSys)
|
||||
v.Set("key", key)
|
||||
@@ -59,7 +60,7 @@ func (adm *AdminClient) HelpConfigKV(subSys, key string, envOnly bool) (Help, er
|
||||
}
|
||||
|
||||
// Execute GET on /minio/admin/v2/help-config-kv
|
||||
resp, err := adm.executeMethod(http.MethodGet, reqData)
|
||||
resp, err := adm.executeMethod(ctx, http.MethodGet, reqData)
|
||||
if err != nil {
|
||||
return Help{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user