redis_pool.py 411 B

12345678910111213
  1. import redis
  2. from django.conf import settings
  3. redis_host = settings.REDIS_HOST
  4. redis_db = settings.REDIS_DB
  5. redis_port = settings.REDIS_PORT
  6. redis_password = settings.REDIS_PASSWORD
  7. if redis_password:
  8. POOL = redis.ConnectionPool(host=redis_host, port=redis_port, password=redis_password, max_connections=1000)
  9. else:
  10. POOL = redis.ConnectionPool(host=redis_host, port=redis_port, max_connections=1000)