Fix wait_for_backend function to use the correct URL for health checks

- Updated the health check logic in the wait_for_backend function to use the caller-provided URL directly, eliminating the issue of appending an extra "/health" segment that caused unnecessary delays in the frontend startup.
- Added comments to clarify the changes and their impact on the entrypoint behavior.
This commit is contained in:
2026-04-24 16:30:54 -05:00
parent c06b51c18e
commit 1dadcc6482

View File

@@ -11,7 +11,11 @@ wait_for_backend() {
echo "Esperando a que el backend esté disponible en ${url}..."
while [ $attempt -le $max_attempts ]; do
if wget -q -O /dev/null "${url}/health" 2>/dev/null; then
# NOTA: usar la URL tal cual la pasa el caller. Antes esta función agregaba
# un "/health" extra al final (resultando en /api/health/health → 404), lo
# que provocaba que el entrypoint esperara 30 intentos en vano antes de
# arrancar Vite, sumando ~90 s muertos al arranque del frontend.
if wget -q -O /dev/null "${url}" 2>/dev/null; then
echo "✓ Backend está listo"
return 0
fi