From d2b1b5a9102ae80e10c0420e4e4fc1086c96d8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=B0=8F=E7=99=BD?= <296015668@qq.com> Date: Thu, 31 Oct 2024 08:38:51 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E7=8A=B6=E6=80=81=E6=A3=80=E6=B5=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/5_db_backup.sh | 3 ++- scripts/6_db_restore.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/5_db_backup.sh b/scripts/5_db_backup.sh index dc1ecd2..9068ec1 100755 --- a/scripts/5_db_backup.sh +++ b/scripts/5_db_backup.sh @@ -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 diff --git a/scripts/6_db_restore.sh b/scripts/6_db_restore.sh index 09b693d..5467ec3 100755 --- a/scripts/6_db_restore.sh +++ b/scripts/6_db_restore.sh @@ -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