From 057884311a1b4f6800919628338429ce79778272 Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Fri, 8 Mar 2024 17:09:19 +0800 Subject: [PATCH 1/3] Fix bug Remove duplicate function definitions (#2033) * delete * delete log --- scripts/lib/util.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index f66971252..7bcfbad97 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -1795,10 +1795,6 @@ openim::util::stop_services_on_ports() { return 0 fi } -# nc -l -p 12345 -# nc -l -p 123456 -# ps -ef | grep "nc -l" -# openim::util::stop_services_on_ports 1234 12345 # The `openim::util::stop_services_with_name` function stops services with specified names. From 2acdfde56e72d62f1153cab3249f8218e1415b3d Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Fri, 8 Mar 2024 17:21:50 +0800 Subject: [PATCH 2/3] Fix bug configGetEnv failed,err:string to int failed: strconv.Atoi: parsing "openim_v3": invalid syntaxr (#2044) * delete * add context deadline exceeded * Error not handled * Error not handled * Error not handled * Error not handled * configGetEnv failed,err:string to int failed: strconv.Atoi: parsing "openim_v3": invalid syntaxr --- config/templates/env.template | 1 + deployments/templates/env-template.yaml | 1 + scripts/start-all.sh | 2 +- tools/component/component.go | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/templates/env.template b/config/templates/env.template index b4f9c868d..7a095b2bb 100644 --- a/config/templates/env.template +++ b/config/templates/env.template @@ -118,6 +118,7 @@ MONGO_OPENIM_PASSWORD=openIM123 # Default: MONGO_DATABASE=openim_v3 MONGO_DATABASE=openim_v3 +MONGO_MAX_POOL_SIZE=100 # ----- Redis Configuration ----- # Port on which Redis in-memory data structure store is running. diff --git a/deployments/templates/env-template.yaml b/deployments/templates/env-template.yaml index 1044dd6bc..85619b422 100644 --- a/deployments/templates/env-template.yaml +++ b/deployments/templates/env-template.yaml @@ -118,6 +118,7 @@ MONGO_OPENIM_PASSWORD=${MONGO_OPENIM_PASSWORD} # Default: MONGO_DATABASE=openim_v3 MONGO_DATABASE=${MONGO_DATABASE} +MONGO_MAX_POOL_SIZE=${MONGO_MAX_POOL_SIZE} # ----- Redis Configuration ----- # Port on which Redis in-memory data structure store is running. diff --git a/scripts/start-all.sh b/scripts/start-all.sh index aac4b1837..952995032 100755 --- a/scripts/start-all.sh +++ b/scripts/start-all.sh @@ -63,7 +63,7 @@ function execute_start_scripts() { if openim::util::is_running_in_container; then - exec > ${DOCKER_LOG_FILE} 2>&1 + exec >> ${DOCKER_LOG_FILE} 2>&1 fi diff --git a/tools/component/component.go b/tools/component/component.go index c7c135549..0532030ff 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -297,9 +297,9 @@ func configGetEnv(config *config.GlobalConfig) error { config.Mongo.Password = getEnv("MONGO_OPENIM_PASSWORD", config.Mongo.Password) config.Mongo.Address = getArrEnv("MONGO_ADDRESS", "MONGO_PORT", config.Mongo.Address) config.Mongo.Database = getEnv("MONGO_DATABASE", config.Mongo.Database) - maxPoolSize, err := getEnvInt("MONGO_DATABASE", config.Mongo.MaxPoolSize) + maxPoolSize, err := getEnvInt("MONGO_MAX_POOL_SIZE", config.Mongo.MaxPoolSize) if err != nil { - return err + return errs.Wrap(err, "MONGO_MAX_POOL_SIZE") } config.Mongo.MaxPoolSize = maxPoolSize From fabcb5317fdebca731e8d34b5eb29121ac8f35d4 Mon Sep 17 00:00:00 2001 From: skiffer-git <72860476+skiffer-git@users.noreply.github.com> Date: Fri, 8 Mar 2024 20:19:33 +0800 Subject: [PATCH 3/3] delete log (#2047) --- tools/component/component.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/component/component.go b/tools/component/component.go index 0532030ff..6893ebf2c 100644 --- a/tools/component/component.go +++ b/tools/component/component.go @@ -77,7 +77,7 @@ func main() { err = configGetEnv(conf) if err != nil { - fmt.Printf("configGetEnv failed,err:%v", err) + fmt.Printf("configGetEnv failed, err:%v", err) return }