mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 02:42:19 +08:00
fix: fix the error
This commit is contained in:
parent
e729fe62e1
commit
5a96112d24
@ -63,7 +63,7 @@ func initCfg() error {
|
|||||||
type checkFunc struct {
|
type checkFunc struct {
|
||||||
name string
|
name string
|
||||||
function func() error
|
function func() error
|
||||||
authInfo string
|
authErrInfo string
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -79,11 +79,11 @@ func main() {
|
|||||||
|
|
||||||
checks := []checkFunc{
|
checks := []checkFunc{
|
||||||
//{name: "Mysql", function: checkMysql},
|
//{name: "Mysql", function: checkMysql},
|
||||||
{name: "Mongo", function: checkMongo, authInfo: MongoAuthFailed},
|
{name: "Mongo", function: checkMongo, authErrInfo: MongoAuthFailed},
|
||||||
{name: "Redis", function: checkRedis, authInfo: RedisAuthFailed},
|
{name: "Redis", function: checkRedis, authErrInfo: RedisAuthFailed},
|
||||||
{name: "Minio", function: checkMinio, authInfo: MinioAuthFailed},
|
{name: "Minio", function: checkMinio, authErrInfo: MinioAuthFailed},
|
||||||
{name: "Zookeeper", function: checkZookeeper, authInfo: ZkAuthFailed},
|
{name: "Zookeeper", function: checkZookeeper, authErrInfo: ZkAuthFailed},
|
||||||
{name: "Kafka", function: checkKafka, authInfo: KafkaAuthFailed},
|
{name: "Kafka", function: checkKafka, authErrInfo: KafkaAuthFailed},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < maxRetry; i++ {
|
for i := 0; i < maxRetry; i++ {
|
||||||
@ -101,27 +101,27 @@ func main() {
|
|||||||
for _, check := range checks {
|
for _, check := range checks {
|
||||||
err = check.function()
|
err = check.function()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errorJudge(err, check.authInfo) {
|
if errorJudge(err, check.authErrInfo) {
|
||||||
disruptions = true
|
disruptions = true
|
||||||
}
|
}
|
||||||
ErrorPrint(fmt.Sprintf("Starting %s failed, %v, the conneted info is:%s", check.name, err, errInfo))
|
ErrorPrint(fmt.Sprintf("Starting %s failed:%v, conneted info:%s", check.name, err, errInfo))
|
||||||
allSuccess = false
|
allSuccess = false
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
component.SuccessPrint(fmt.Sprintf("%s connected successfully, the addr is:%s", check.name, errInfo))
|
component.SuccessPrint(fmt.Sprintf("%s connected successfully, address:%s", check.name, errInfo))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if allSuccess {
|
|
||||||
component.SuccessPrint("All components started successfully!")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if disruptions {
|
if disruptions {
|
||||||
component.ErrorPrint(fmt.Sprintf("component check exit,err: %v", err))
|
component.ErrorPrint(fmt.Sprintf("component check exit,err: %v", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if allSuccess {
|
||||||
|
component.SuccessPrint("All components started successfully!")
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user