|
|
@ -27,13 +27,18 @@ def setup_default_arguments(args, settings):
|
|
|
|
""" Sets up args from settings or defaults """
|
|
|
|
""" Sets up args from settings or defaults """
|
|
|
|
if args.host is None:
|
|
|
|
if args.host is None:
|
|
|
|
args.host = settings.get('REDIS_HOST', 'localhost')
|
|
|
|
args.host = settings.get('REDIS_HOST', 'localhost')
|
|
|
|
|
|
|
|
|
|
|
|
if args.port is None:
|
|
|
|
if args.port is None:
|
|
|
|
args.port = int(settings.get('REDIS_PORT', 6379))
|
|
|
|
args.port = int(settings.get('REDIS_PORT', 6379))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
args.port = int(args.port)
|
|
|
|
args.port = int(args.port)
|
|
|
|
|
|
|
|
|
|
|
|
if args.db is None:
|
|
|
|
if args.db is None:
|
|
|
|
args.db = settings.get('REDIS_DB', 0)
|
|
|
|
args.db = settings.get('REDIS_DB', 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if args.password is None:
|
|
|
|
|
|
|
|
args.password = settings.get('REDIS_PASSWORD', None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def setup_redis(args):
|
|
|
|
def setup_redis(args):
|
|
|
|
redis_conn = redis.Redis(host=args.host, port=args.port, db=args.db,
|
|
|
|
redis_conn = redis.Redis(host=args.host, port=args.port, db=args.db,
|
|
|
|