暂无描述

func_settings.py 457B

1234567891011121314151617
  1. # -*- coding: utf-8 -*-
  2. import redis_extensions as redis
  3. def redis_conf(conf):
  4. return {
  5. 'host': conf.get('HOST', 'localhost'),
  6. 'port': conf.get('PORT', 6379),
  7. 'password': '{}:{}'.format(conf.get('USER', ''), conf.get('PASSWORD', '')) if conf.get('USER') else '',
  8. 'db': conf.get('db', 0),
  9. }
  10. def redis_connect(conf):
  11. return redis.StrictRedisExtensions(connection_pool=redis.ConnectionPool(**redis_conf(conf)))