From 6bab34bf13ea13d9fd5cf08aa47d25b9f80fad99 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 21 Feb 2026 10:14:14 -0500 Subject: [PATCH] up --- api/version/media-url.php | 5 ++++- docker/entrypoint.sh | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/api/version/media-url.php b/api/version/media-url.php index 798a3f5..9e87c8c 100644 --- a/api/version/media-url.php +++ b/api/version/media-url.php @@ -5,6 +5,10 @@ * - Si se solicita JSON (Accept: application/json) la endpoint requiere autenticación y devuelve {success:true,url:...} * - Si se accede mediante GET desde navegador, redirige (302) al URL del media (no requiere sesión) */ +// Continuar procesando aunque Cloudflare/cliente corte la conexión (evita 502 por timeout) +ignore_user_abort(true); +set_time_limit(300); + require_once __DIR__ . '/../../config/config.php'; // Debugging helpers: log errors to a file and initialize control vars @@ -291,7 +295,6 @@ if ($mediaId) { // ── Si no hay archivo local, descargar con MediaService y guardar como cache permanente ── if ($mediaId) { try { - set_time_limit(180); // Dar tiempo suficiente para fotos grandes (hasta 5MB) require_once __DIR__ . '/../../classes/MediaService.php'; $ms = new MediaService(); $subdir = date('Y/m'); diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b4b4dff..cf057be 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -115,9 +115,9 @@ if [ -f /usr/local/bin/php ]; then php -r "if(function_exists('opcache_reset')) opcache_reset();" fi -# Configurar crontab para tareas programadas +# Configurar crontab para tareas programadas (usar /etc/crontabs/root para que crond lo ejecute como root) echo "⏰ Configurando cron jobs..." -cat > /etc/crontabs/www < /etc/crontabs/root <processDelayed('messages'); \$q->processDelayed('media');" 2>&1 | logger -t delayed-processor @@ -130,7 +130,6 @@ cat > /etc/crontabs/www <&1 | logger -t worker-monitor EOF -chown www:www /etc/crontabs/www echo "✅ Configuración completada" echo "🎯 Iniciando servicios..."