mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Add admin info timeouts (#20249)
Since a lot of operations load from storage, do remote calls, add a 10 second timeout to each operation. This should make `mc admin info` return values even under extreme conditions.
This commit is contained in:
@@ -1099,6 +1099,8 @@ func (sys *NotificationSys) ServerInfo(ctx context.Context, metrics bool) []madm
|
||||
wg.Add(1)
|
||||
go func(client *peerRESTClient, idx int) {
|
||||
defer wg.Done()
|
||||
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
|
||||
defer cancel()
|
||||
info, err := client.ServerInfo(ctx, metrics)
|
||||
if err != nil {
|
||||
info.Endpoint = client.host.String()
|
||||
|
||||
Reference in New Issue
Block a user