From 7ad79bdbc94dadb8db00f8ccb0d8486833c2f4bc Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Mon, 15 Sep 2025 09:21:13 +0200 Subject: [PATCH] =?UTF-8?q?=C3=84nderung:=20Erweiterung=20der=20Protokolla?= =?UTF-8?q?usgaben=20in=20redis.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Änderungen: - Hinzufügung von Debug-Protokollausgaben zur Anzeige aller relevanten Umgebungsvariablen für die Redis-Konfiguration. - Detaillierte Protokollierung der finalen Redis-Konfiguration, einschließlich Host, Port, Passwort und URL. Diese Anpassungen verbessern die Transparenz und erleichtern die Fehlersuche bei der Redis-Konfiguration. --- backend/utils/redis.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/utils/redis.js b/backend/utils/redis.js index d4eb566..864b50e 100644 --- a/backend/utils/redis.js +++ b/backend/utils/redis.js @@ -4,11 +4,25 @@ import User from '../models/community/user.js'; const EXPIRATION_TIME = 30 * 60 * 1000; +// Debug: Zeige alle Umgebungsvariablen +console.log('[redis] DEBUG - Alle Umgebungsvariablen:'); +console.log('[redis] process.env.REDIS_HOST:', process.env.REDIS_HOST); +console.log('[redis] process.env.REDIS_PORT:', process.env.REDIS_PORT); +console.log('[redis] process.env.REDIS_PASSWORD:', process.env.REDIS_PASSWORD ? '***gesetzt***' : 'NICHT GESETZT'); +console.log('[redis] process.env.REDIS_PASS:', process.env.REDIS_PASS ? '***gesetzt***' : 'NICHT GESETZT'); +console.log('[redis] process.env.REDIS_URL:', process.env.REDIS_URL); + const redisHost = process.env.REDIS_HOST || '127.0.0.1'; const redisPort = process.env.REDIS_PORT || '6379'; const redisPassword = process.env.REDIS_PASSWORD || process.env.REDIS_PASS || undefined; const redisUrl = process.env.REDIS_URL || `redis://${redisHost}:${redisPort}`; +console.log('[redis] Finale Redis-Konfiguration:'); +console.log('[redis] redisHost:', redisHost); +console.log('[redis] redisPort:', redisPort); +console.log('[redis] redisPassword:', redisPassword ? '***gesetzt***' : 'NICHT GESETZT'); +console.log('[redis] redisUrl:', redisUrl); + if (!process.env.REDIS_HOST || !process.env.REDIS_PORT) { console.warn(`[redis] Verwende Fallback ${redisHost}:${redisPort}`); }