synapse.. 10_install

This commit is contained in:
Gitouche 2023-08-12 13:54:12 +02:00
parent c47deeeb6b
commit ef10a6ed93

View file

@ -43,20 +43,22 @@ podman-compose --pod-args="--infra=true --infra-name=${project_name}_infra --sha
end=$((SECONDS+120)) end=$((SECONDS+120))
while [ $SECONDS -lt $end ]; do while [ $SECONDS -lt $end ]; do
sleep 1 sleep 1
if check_container_running synapse; then if check_container_running ${container_name}; then
podman logs synapse 2>&1 | grep -qe 'Preparing for databases' && podman logs ${container_name} 2>&1 | grep -qe 'Preparing for databases' &&
break break
else else
podman logs synapse 2>&1 | grep -qe 'psycopg2.OperationalError: could not connect to server: Connection refused' && podman logs ${container_name} 2>&1 | grep -qe 'psycopg2.OperationalError: could not connect to server: Connection refused' &&
podman healthcheck run synapse-db && podman healthcheck run ${db_container_name} &&
echo "Oops, synapse didn't wait for PostgreSQL, restarting" echo "Oops, synapse didn't wait for PostgreSQL, restarting"
podman start synapse podman start ${container_name}
fi fi
done && done &&
podman container wait --condition=running ${container_name} &&
echo -n "Waiting for background tasks to end... " && echo -n "Waiting for background tasks to end... " &&
( podman container logs --tail=10 -f ${container_name} 2>&1 & ) | grep -q 'No more background updates to do' && ( podman container logs --tail=50 -f ${container_name} 2>&1 & ) | grep -q 'No more background updates to do' &&
echo "OK." && echo "OK." || retval=false
podman pod stop ${pod_name} && podman pod stop ${pod_name} &&
echo "Done. Pod built and stopped." echo "Done. Pod stopped."
shred -u .env shred -u .env
eval "$retval"