From 1494dabc45218238cac07486dff71171beb6539c Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 8 Oct 2021 19:11:41 +0200 Subject: [PATCH] Fix --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 65ef44f..324f311 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -192,12 +192,13 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then tmp_dump_logs="$(mktemp -p $DUMPS_DIR)" ynh_debug --message="Running import command" + dump=$(find $DUMPS_DIR -name "$dump_id.tar.gz" -o -name "$dump_id.dump" | head -1) /usr/bin/meilisearch --db-path $DUMPS_DIR/data.ms --import-dump $DUMPS_DIR/$dump_id.* --master-key $master_key --http-addr 127.0.0.1:$port --no-analytics true &> $tmp_dump_logs & dump_pid=$! dump_timeout=300 for i in $(seq $dump_timeout) do - if grep --quiet 'Dump importation from ".*" succeed' $tmp_dump_logs; + if [ "$(curl --silent -X GET "$BASE_URL/health" | jq -r ".status")" == "available" ] then ynh_debug --message="Importation succeeded" break