From beeae4956d228aa596eee09f2a0b450dccdfaeae Mon Sep 17 00:00:00 2001 From: luhaoling <2198702716@qq.com> Date: Tue, 27 Feb 2024 10:17:52 +0800 Subject: [PATCH] fix: use printf replace the echo --- internal/msgtransfer/init.go | 4 +--- scripts/lib/util.sh | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/msgtransfer/init.go b/internal/msgtransfer/init.go index ac545f198..add3c197a 100644 --- a/internal/msgtransfer/init.go +++ b/internal/msgtransfer/init.go @@ -149,7 +149,7 @@ func (m *MsgTransfer) Start(prometheusPort int) error { m.cancel() m.historyCH.historyConsumerGroup.Close() m.historyMongoCH.historyConsumerGroup.Close() - + return nil case <-netDone: m.cancel() m.historyCH.historyConsumerGroup.Close() @@ -157,6 +157,4 @@ func (m *MsgTransfer) Start(prometheusPort int) error { close(netDone) return netErr } - - return nil } diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 6cf5a0343..5dcb85bcb 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -1619,7 +1619,7 @@ openim::util::check_ports() { # Print information about ports whose processes are not running. if [[ ${#not_started[@]} -ne 0 ]]; then - echo "\n### Not started ports:" + printf "\n### Not started ports:" for port in "${not_started[@]}"; do openim::log::error "Port $port is not started." done @@ -1627,7 +1627,7 @@ openim::util::check_ports() { # Print information about ports whose processes are running. if [[ ${#started[@]} -ne 0 ]]; then - echo "\n### Started ports:" + printf "\n### Started ports:" for info in "${started[@]}"; do echo "$info" done