diff --git a/qlib/config.py b/qlib/config.py index 11ccc52ecc..7b726c6581 100644 --- a/qlib/config.py +++ b/qlib/config.py @@ -147,6 +147,7 @@ def register_from_C(config, skip_register=True): "redis_host": "127.0.0.1", "redis_port": 6379, "redis_task_db": 1, + "redis_password": None, # This value can be reset via qlib.init "logging_level": logging.INFO, # Global configuration of qlib log diff --git a/qlib/utils/__init__.py b/qlib/utils/__init__.py index 51363f2f7c..910a4c08b2 100644 --- a/qlib/utils/__init__.py +++ b/qlib/utils/__init__.py @@ -44,7 +44,7 @@ #################### Server #################### def get_redis_connection(): """get redis connection instance.""" - return redis.StrictRedis(host=C.redis_host, port=C.redis_port, db=C.redis_task_db) + return redis.StrictRedis(host=C.redis_host, port=C.redis_port, db=C.redis_task_db, password=C.redis_password) #################### Data ####################