diff --git a/requests_respectful/globals.py b/requests_respectful/globals.py index e11d83e..eb8b780 100644 --- a/requests_respectful/globals.py +++ b/requests_respectful/globals.py @@ -16,6 +16,7 @@ "redis": { "host": "localhost", "port": 6379, + "password": None, "database": 0 }, "safety_threshold": 10, @@ -45,7 +46,7 @@ if "redis" not in config: raise RequestsRespectfulConfigError("'redis' key is missing from 'requests-respectful.config.yml'") - expected_redis_keys = ["host", "port", "database"] + expected_redis_keys = ["host", "port", "password", "database"] missing_redis_keys = list() for expected_redis_key in expected_redis_keys: @@ -67,5 +68,6 @@ redis = StrictRedis( host=config["redis"]["host"], port=config["redis"]["port"], + password=config["redis"]["password"], db=config["redis"]["database"] ) diff --git a/requests_respectful/respectful_requester.py b/requests_respectful/respectful_requester.py index 6a7693f..27a781f 100644 --- a/requests_respectful/respectful_requester.py +++ b/requests_respectful/respectful_requester.py @@ -111,7 +111,7 @@ def configure(cls, **kwargs): if type(kwargs["redis"]) != dict: raise RequestsRespectfulConfigError("'redis' key must be a dict") - expected_redis_keys = ["host", "port", "database"] + expected_redis_keys = ["host", "port", "password", "database"] missing_redis_keys = list() for expected_redis_key in expected_redis_keys: @@ -130,6 +130,7 @@ def configure(cls, **kwargs): redis = StrictRedis( host=config["redis"]["host"], port=config["redis"]["port"], + password=config["redis"]["password"], db=config["redis"]["database"] )