Skip to content

Commit

Permalink
perf: 初始化容器状态检测优化
Browse files Browse the repository at this point in the history
  • Loading branch information
wojiushixiaobai authored and BaiJiangJie committed Oct 31, 2024
1 parent 4a2d621 commit cb19a37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/5_db_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ function main() {

mysql_images=$(get_mysql_images)

if ! docker ps | grep jms_ >/dev/null; then
if ! docker ps | grep -w "jms_core" &>/dev/null; then
create_db_ops_env
flag=1
fi

if [[ "${DB_HOST}" == "mysql" ]]; then
while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_mysql)" != "healthy" ]]; do
sleep 5s
Expand Down
3 changes: 2 additions & 1 deletion scripts/6_db_restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ function main() {

echo "$(gettext 'Start restoring database'): $DB_FILE"

if ! docker ps | grep jms_ >/dev/null; then
if ! docker ps | grep -w "jms_core" &>/dev/null; then
create_db_ops_env
flag=1
fi

if [[ "${DB_HOST}" == "mysql" ]]; then
while [[ "$(docker inspect -f "{{.State.Health.Status}}" jms_mysql)" != "healthy" ]]; do
sleep 5s
Expand Down

0 comments on commit cb19a37

Please sign in to comment.