Download app/core/db_pool.py from cryptorugmunch/rugmuncher-backend: direct link, hf CLI and curl.
- Browser
- Download file 335 Bytes
-
https://huggingface.co/cryptorugmunch/rugmuncher-backend/resolve/main/app/core/db_pool.py
- Command line
-
hf download hf://cryptorugmunch/rugmuncher-backend/app/core/db_pool.py
-
curl -L -o db_pool.py https://huggingface.co/cryptorugmunch/rugmuncher-backend/resolve/main/app/core/db_pool.py
335 Bytes
| """Database connection pooling — Redis + Postgres with auto-reconnect.""" | |
| import logging | |
| import os | |
| logger = logging.getLogger(__name__) | |
| REDIS_URL = os.getenv("REDIS_URL", "redis://localhost:6379/0") | |
| PG_URL = os.getenv("DATABASE_URL", "postgresql://postgres:postgres@localhost:5432/postgres") | |
| _redis_pool = None | |
| _pg_pool = None | |