fix: check for gateway backend online without http request (#10924)

fixes #10921
This commit is contained in:
Harshavardhana authored and GitHub committed 2020-11-19 10:38:02 -08:00
1 parent d778d9493f
commit 0f9e125cf3
4 files changed
+20 -18

No files matched your search

+5 -1
View File
@@ -276,7 +276,11 @@ func (l *s3Objects) Shutdown(ctx context.Context) error {
// StorageInfo is not relevant to S3 backend.
func (l *s3Objects) StorageInfo(ctx context.Context, _ bool) (si minio.StorageInfo, _ []error) {
si.Backend.Type = minio.BackendGateway
si.Backend.GatewayOnline = minio.IsBackendOnline(ctx, l.HTTPClient, l.Client.EndpointURL().String())
host := l.Client.EndpointURL().Host
if l.Client.EndpointURL().Port() == "" {
host = l.Client.EndpointURL().Host + ":" + l.Client.EndpointURL().Scheme
}
si.Backend.GatewayOnline = minio.IsBackendOnline(ctx, host)
return si, nil
}