This commit is contained in:
Hossein 2025-08-11 22:33:55 +03:30
parent 2026e0fbfb
commit bec32b4df2

View File

@ -21,8 +21,10 @@ def _get_redis_client() -> Optional[redis.Redis]:
logger.info("✅ Redis connection established")
return _redis_client
except Exception as e:
logger.warning(f"⚠️ Redis connection failed: {e}")
logger.warning("📝 Pagination will be disabled - posts may be duplicated")
# Only log once per application startup
if _redis_client is None: # First failure
logger.warning(f"⚠️ Redis connection failed: {e}")
logger.warning("📝 Pagination will be disabled - posts may be duplicated")
_redis_client = None
return None