fix: fix the error

This commit is contained in:
luhaoling 2024-02-22 14:41:46 +08:00
parent 9318322fa5
commit 93f2034572
2 changed files with 6 additions and 4 deletions

View File

@ -47,12 +47,14 @@ function openim::api::start() {
openim::log::info "Starting ${SERVER_NAME} ..."
readonly OPENIM_API_SERVER_LIBRARIES="${OPENIM_OUTPUT_HOSTBIN}/${SERVER_NAME}"
openim::util::stop_services_with_name ${OPENIM_API_SERVER_LIBRARIES}
printf "+------------------------+--------------+\n"
printf "| Service Name | Port |\n"
printf "+------------------------+--------------+\n"
readonly OPENIM_API_SERVER_LIBRARIES="${OPENIM_OUTPUT_HOSTBIN}/${SERVER_NAME}"
openim::util::stop_services_with_name ${OPENIM_API_SERVER_LIBRARIES}
local length=${#OPENIM_API_SERVICE_LISTARIES[@]}
for ((i=0; i<length; i++)); do

View File

@ -684,9 +684,9 @@ openim::util::stop_services_with_name() {
all_pids_empty=true
for server_name in "$@"; do
pids=$(pgrep -f "$server_name")
server_pids=$(pgrep -f "$server_name")
if [[ ! -z $pids ]]; then
if [[ ! -z $server_pids ]]; then
all_pids_empty=false
break # If at least one process corresponding to server_name is found, jump out of the for loop.
fi