mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Handle connection failures on webhook/url pings (#8204)
Properly handle connection failures while replaying events Fixes #8194
This commit is contained in:
committed by
Harshavardhana
parent
ff6aabd9c0
commit
8700945cdf
@@ -35,6 +35,7 @@ import (
|
||||
"github.com/inconshreveable/go-update"
|
||||
xhttp "github.com/minio/minio/cmd/http"
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
xnet "github.com/minio/minio/pkg/net"
|
||||
_ "github.com/minio/sha256-simd" // Needed for sha256 hash verifier.
|
||||
)
|
||||
|
||||
@@ -283,7 +284,7 @@ func downloadReleaseURL(releaseChecksumURL string, timeout time.Duration, mode s
|
||||
client := &http.Client{Transport: getUpdateTransport(timeout)}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
if isNetworkOrHostDown(err) {
|
||||
if xnet.IsNetworkOrHostDown(err) {
|
||||
return content, AdminError{
|
||||
Code: AdminUpdateURLNotReachable,
|
||||
Message: err.Error(),
|
||||
@@ -500,7 +501,7 @@ func doUpdate(updateURL, sha256Hex, mode string) (err error) {
|
||||
|
||||
resp, err := clnt.Do(req)
|
||||
if err != nil {
|
||||
if isNetworkOrHostDown(err) {
|
||||
if xnet.IsNetworkOrHostDown(err) {
|
||||
return AdminError{
|
||||
Code: AdminUpdateURLNotReachable,
|
||||
Message: err.Error(),
|
||||
|
||||
Reference in New Issue
Block a user