mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-04-28 06:19:20 +08:00
Skip minio check (#2281)
* If MinIO is not being used, then do not perform the MinIO check. * If MinIO is not being used, then do not perform the MinIO check. * If MinIO is not being used, then do not perform the MinIO check. * If MinIO is not being used, then do not perform the MinIO check. * kill binary before build * Stop the process before compiling. * Stop the process before compiling.
This commit is contained in:
@@ -66,6 +66,7 @@ func initConfig(configDir string) (*config.Mongo, *config.Redis, *config.Kafka,
|
||||
kafkaConfig = &config.Kafka{}
|
||||
minioConfig = &config.Minio{}
|
||||
zookeeperConfig = &config.ZooKeeper{}
|
||||
thirdConfig = &config.Third{}
|
||||
)
|
||||
err := config.LoadConfig(filepath.Join(configDir, cmd.MongodbConfigFileName), cmd.ConfigEnvPrefixMap[cmd.MongodbConfigFileName], mongoConfig)
|
||||
if err != nil {
|
||||
@@ -82,11 +83,19 @@ func initConfig(configDir string) (*config.Mongo, *config.Redis, *config.Kafka,
|
||||
return nil, nil, nil, nil, nil, err
|
||||
}
|
||||
|
||||
err = config.LoadConfig(filepath.Join(configDir, cmd.MinioConfigFileName), cmd.ConfigEnvPrefixMap[cmd.MinioConfigFileName], minioConfig)
|
||||
err = config.LoadConfig(filepath.Join(configDir, cmd.OpenIMRPCThirdCfgFileName), cmd.ConfigEnvPrefixMap[cmd.OpenIMRPCThirdCfgFileName], thirdConfig)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, err
|
||||
}
|
||||
|
||||
if thirdConfig.Object.Enable == "minio" {
|
||||
err = config.LoadConfig(filepath.Join(configDir, cmd.MinioConfigFileName), cmd.ConfigEnvPrefixMap[cmd.MinioConfigFileName], minioConfig)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, err
|
||||
}
|
||||
} else {
|
||||
minioConfig = nil
|
||||
}
|
||||
err = config.LoadConfig(filepath.Join(configDir, cmd.ZookeeperConfigFileName), cmd.ConfigEnvPrefixMap[cmd.ZookeeperConfigFileName], zookeeperConfig)
|
||||
if err != nil {
|
||||
return nil, nil, nil, nil, nil, err
|
||||
@@ -131,14 +140,17 @@ func performChecks(ctx context.Context, mongoConfig *config.Mongo, redisConfig *
|
||||
"Redis": func() error {
|
||||
return CheckRedis(ctx, redisConfig)
|
||||
},
|
||||
"MinIO": func() error {
|
||||
return CheckMinIO(ctx, minioConfig)
|
||||
},
|
||||
"Kafka": func() error {
|
||||
return CheckKafka(ctx, kafkaConfig)
|
||||
},
|
||||
}
|
||||
|
||||
if minioConfig != nil {
|
||||
checks["MinIO"] = func() error {
|
||||
return CheckMinIO(ctx, minioConfig)
|
||||
}
|
||||
}
|
||||
|
||||
for i := 0; i < maxRetry; i++ {
|
||||
allSuccess := true
|
||||
for name, check := range checks {
|
||||
|
||||
Reference in New Issue
Block a user