feat: add more test code

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/926/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent 2c4449898e
commit cb707f0959
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE

@ -34,15 +34,15 @@ function openim::msggateway::start()
# OpenIM message gateway service port
OPENIM_MESSAGE_GATEWAY_PORTS=$(openim::util::list-to-string ${OPENIM_MESSAGE_GATEWAY_PORT} )
read -a OPENIM_MSGGATEWAY_PORTS_ARRAY <<< $(openim::util::list-to-string ${OPENIM_MESSAGE_GATEWAY_PORT} )
read -a OPENIM_MSGGATEWAY_PORTS_ARRAY <<< ${OPENIM_MESSAGE_GATEWAY_PORTS}
# OpenIM WS port
OPENIM_WS_PORTS=$(openim::util::list-to-string ${OPENIM_WS_PORT} )
read -a OPENIM_WS_PORTS_ARRAY <<< $(openim::util::list-to-string ${OPENIM_WS_PORT} )
read -a OPENIM_WS_PORTS_ARRAY <<< ${OPENIM_WS_PORTS}
# Message Gateway Prometheus port of the service
MSG_GATEWAY_PROM_PORTS=$(openim::util::list-to-string ${MSG_GATEWAY_PROM_PORT} )
read -a MSG_GATEWAY_PROM_PORTS_ARRAY <<< $(openim::util::list-to-string ${MSG_GATEWAY_PROM_PORT} )
read -a MSG_GATEWAY_PROM_PORTS_ARRAY <<< ${MSG_GATEWAY_PROM_PORTS}
openim::log::status "OpenIM Mssage Getway ports: ${OPENIM_MESSAGE_GATEWAY_PORTS[*]}"
openim::log::status "OpenIM WS ports: ${OPENIM_WS_PORTS[*]}"

@ -127,8 +127,12 @@ function openim::rpc::start() {
# Get the service and Prometheus ports.
OPENIM_RPC_SERVICE_PORTS=( $(openim::util::list-to-string ${OPENIM_RPC_PORT_LISTARIES[$i]}) )
read -a OPENIM_RPC_SERVICE_PORTS_ARRAY <<< ${OPENIM_RPC_SERVICE_PORTS}
OPENIM_RPC_PROM_PORTS=( $(openim::util::list-to-string ${OPENIM_RPC_PROM_PORT_LISTARIES[$i]}) )
for ((j = 0; j < ${#OPENIM_RPC_SERVICE_PORTS[@]}; j++)); do
read -a OPENIM_RPC_PROM_PORTS_ARRAY <<< ${OPENIM_RPC_PROM_PORTS}
for ((j = 0; j < ${#OPENIM_RPC_SERVICE_PORTS_ARRAY[@]}; j++)); do
openim::log::info "Starting ${OPENIM_RPC_SERVICE_LISTARIES[$i]} service, port: ${OPENIM_RPC_SERVICE_PORTS[j]}, prometheus port: ${OPENIM_RPC_PROM_PORTS[j]}, binary root: ${OPENIM_OUTPUT_HOSTBIN}/${OPENIM_RPC_SERVICE_LISTARIES[$i]}"
openim::rpc::start_service "${OPENIM_RPC_SERVICE_LISTARIES[$i]}" "${OPENIM_RPC_SERVICE_PORTS[j]}" "${OPENIM_RPC_PROM_PORTS[j]}"
sleep 0.5

Loading…
Cancel
Save