Skip to content

Commit

Permalink
feat: optimize openim reset code (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
cubxxw authored Mar 4, 2024
1 parent 4be1866 commit 830d585
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/scripts-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
sudo make start
sudo make check
sudo cat logs/chat_$(date '+%Y%m%d').log 2>/dev/null
sudo cat _output/logs/chat_$(date '+%Y%m%d').log 2>/dev/null
echo "pwd = $(pwd)"
cd ..
ls -al && pwd
Expand All @@ -110,13 +110,13 @@ jobs:
run: |
sudo make init && \
sudo make start || \
(echo "An error occurred, printing logs:" && sudo cat ./logs/* 2>/dev/null)
(echo "An error occurred, printing logs:" && sudo cat ./_output/logs/* 2>/dev/null)
shell: bash

- name: Check all services
run: |
sudo make check || \
(echo "An error occurred, printing logs:" && sudo cat ./logs/* 2>/dev/null)
(echo "An error occurred, printing logs:" && sudo cat ./_output/logs/* 2>/dev/null)
shell: bash

- name: Stop chat
Expand All @@ -130,7 +130,7 @@ jobs:
- name: Print chat_$(date '+%Y%m%d').log
run: |
ls -al && echo "pwd = $(pwd)"
sudo cat ./logs/* 2>/dev/null
sudo cat ./logs/* 2>/dev/null >> "$GITHUB_OUTPUT"
sudo cat ./_output/logs/* 2>/dev/null
sudo cat ./_output/logs/* 2>/dev/null >> "$GITHUB_OUTPUT"
shell: bash
continue-on-error: true
2 changes: 1 addition & 1 deletion deployments/helm-charts/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ config:

# 没有配置表示和OpenIM一致
log:
storageLocation: ../logs/ #存放目录
storageLocation: ../_output/logs/ #存放目录
rotationTime: 24 #日志旋转时间
remainRotationCount: 2 #日志数量
remainLogLevel: 6 #日志级别 6表示全都打印,
Expand Down
2 changes: 1 addition & 1 deletion deployments/templates/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ mysql:

# Log configuration - defines how logging is handled
log:
storageLocation: ../logs/ # LOG_STORAGE_LOCATION, Directory for storing logs
storageLocation: ../_output/logs/ # LOG_STORAGE_LOCATION, Directory for storing logs
rotationTime: 24 # Log rotation time in hours
remainRotationCount: 2 # Number of log files to retain
remainLogLevel: 6 # Log level (6 = all levels)
Expand Down
2 changes: 1 addition & 1 deletion scripts/admin_rpc_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sleep 1
cd ${push_binary_root}

for ((i = 0; i < ${#rpc_ports[@]}; i++)); do
nohup ./${push_name} -port ${rpc_ports[$i]} -prometheus_port ${prome_ports[$i]} >>../logs/chat_$(date '+%Y%m%d').log 2>&1 &
nohup ./${push_name} -port ${rpc_ports[$i]} -prometheus_port ${prome_ports[$i]} >>../_output/logs/chat_$(date '+%Y%m%d').log 2>&1 &
done

sleep 3
Expand Down
6 changes: 3 additions & 3 deletions scripts/check_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ if [ "$1" == "--print-screen" ]; then
PRINT_SCREEN=1
fi

mkdir -p ${SCRIPTS_ROOT}/../logs
mkdir -p ${SCRIPTS_ROOT}/../_output/logs

if [ -z "$PRINT_SCREEN" ]; then
exec >> ${SCRIPTS_ROOT}/../logs/chat_$(date '+%Y%m%d').log 2>&1
exec >> ${SCRIPTS_ROOT}/../_output/logs/chat_$(date '+%Y%m%d').log 2>&1
fi

#Include shell font styles and some basic information
Expand Down Expand Up @@ -125,7 +125,7 @@ for i in "${!service_ports[@]}"; do

if [[ "$found_port" != true ]]; then
echo -e "${YELLOW_PREFIX}${new_service_name}${COLOR_SUFFIX}${RED_PREFIX} service does not start normally, expected port is ${COLOR_SUFFIX}${YELLOW_PREFIX}${service_port}${COLOR_SUFFIX}"
echo -e "${RED_PREFIX}please check ${SCRIPTS_ROOT}/../logs/chat_$(date '+%Y%m%d').log ${COLOR_SUFFIX}"
echo -e "${RED_PREFIX}please check ${SCRIPTS_ROOT}/../_output/logs/chat_$(date '+%Y%m%d').log ${COLOR_SUFFIX}"
cat ${logs_dir}/chat_err_$(date '+%Y%m%d').log
exit -1
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker_start_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ source "$SCRIPTS_ROOT/path_info.sh"
source "$SCRIPTS_ROOT/function.sh"

bin_dir="$BIN_DIR"
logs_dir="$SCRIPTS_ROOT/../logs"
logs_dir="$SCRIPTS_ROOT/../_output/logs"

if [ ! -d "$logs_dir" ]; then
echo "mkdir -p $logs_dir"
Expand Down

0 comments on commit 830d585

Please sign in to comment.