|
|
@ -31,7 +31,6 @@ import (
|
|
|
|
"github.com/OpenIMSDK/tools/errs"
|
|
|
|
"github.com/OpenIMSDK/tools/errs"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
|
|
|
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
|
|
|
|
|
|
|
|
|
|
|
"gopkg.in/yaml.v3"
|
|
|
|
"gopkg.in/yaml.v3"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
@ -94,7 +93,7 @@ func main() {
|
|
|
|
if i != 0 {
|
|
|
|
if i != 0 {
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
time.Sleep(1 * time.Second)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fmt.Printf("Checking components Round %v...\n", i+1)
|
|
|
|
fmt.Printf("Checking components round %v...\n", i+1)
|
|
|
|
|
|
|
|
|
|
|
|
var err error
|
|
|
|
var err error
|
|
|
|
allSuccess := true
|
|
|
|
allSuccess := true
|
|
|
@ -103,37 +102,29 @@ func main() {
|
|
|
|
err = check.function(check.config)
|
|
|
|
err = check.function(check.config)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
if check.name == "Minio" {
|
|
|
|
if check.name == "Minio" {
|
|
|
|
if errors.Is(err, errMinioNotEnabled) {
|
|
|
|
if errors.Is(err, errMinioNotEnabled) ||
|
|
|
|
fmt.Println(err.Error(), " check ", check.name)
|
|
|
|
errors.Is(err, errSignEndPoint) ||
|
|
|
|
checks[index].flag = true
|
|
|
|
errors.Is(err, errApiURL) {
|
|
|
|
}
|
|
|
|
|
|
|
|
if errors.Is(err, errSignEndPoint) {
|
|
|
|
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error(), " check ", check.name)
|
|
|
|
fmt.Fprintf(os.Stderr, err.Error(), " check ", check.name)
|
|
|
|
checks[index].flag = true
|
|
|
|
checks[index].flag = true
|
|
|
|
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
component.ErrorPrint(fmt.Sprintf("Starting %s failed:%v.", check.name, errs.Unwrap(err).Error()))
|
|
|
|
|
|
|
|
if strings.Contains(errs.Unwrap(err).Error(), "connection refused") ||
|
|
|
|
|
|
|
|
strings.Contains(errs.Unwrap(err).Error(), "timeout") ||
|
|
|
|
|
|
|
|
strings.Contains(errs.Unwrap(err).Error(), "context deadline exceeded") {
|
|
|
|
|
|
|
|
component.ErrorPrint(fmt.Sprintf("try check connection %s", check.name))
|
|
|
|
|
|
|
|
allSuccess = false
|
|
|
|
allSuccess = false
|
|
|
|
|
|
|
|
component.ErrorPrint(fmt.Sprintf("Check component: %s failed:%v.", check.name, err.Error()))
|
|
|
|
break
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
|
|
|
|
checks[index].flag = true
|
|
|
|
checks[index].flag = true
|
|
|
|
component.SuccessPrint(fmt.Sprintf("%s connected successfully", check.name))
|
|
|
|
component.SuccessPrint(fmt.Sprintf("%s connected successfully", check.name))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if allSuccess {
|
|
|
|
if allSuccess {
|
|
|
|
component.SuccessPrint("All components started successfully!")
|
|
|
|
component.SuccessPrint("All components started successfully!")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
component.ErrorPrint("Some components started failed!")
|
|
|
|
component.ErrorPrint("Some components checked failed!")
|
|
|
|
os.Exit(-1)
|
|
|
|
os.Exit(-1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|