Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,14 @@ wait_for_shell_dependency() {
local failure_label=$2
local dependency_location=$3
local dependency_check=$4
local dependency_failure_check=$5
local max_retries=30
local timeout=0

until run_weblate shell -c "$dependency_check" > /dev/null; do
>&2 echo "$wait_label at $dependency_location is unavailable - retrying $((max_retries - timeout))"
((timeout += 1))
if ((timeout > max_retries)); then
run_weblate shell -c "$dependency_failure_check"
run_weblate shell -c "$dependency_check"
fail_dep "$failure_label"
fi
sleep 1
Expand All @@ -278,8 +277,7 @@ wait_for_redis() {
redis \
redis \
"${REDIS_HOST:-cache}" \
'from django.core.cache import cache; "ping" in cache' \
'from django.core.cache import cache; "ping" in cache'
'from django.core.cache import cache; cache.get("ping")'
}

set_postgres_connection_defaults() {
Expand All @@ -294,8 +292,7 @@ wait_for_database() {
"Database server" \
PostgreSQL \
"${POSTGRES_HOST:-db}" \
'from weblate.auth.models import User; User.objects.raw("SELECT 1")' \
'from weblate.auth.models import User; User.objects.exists()'
'from weblate.auth.models import User; User.objects.raw("SELECT 1")'
}

database_version_check_enabled() {
Expand Down
Loading