Skip to content

Commit

Permalink
stop storing sentinel config on storage instance
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Oct 5, 2015
1 parent 0e62fe1 commit 97eacad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions limits/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,18 +396,18 @@ def __init__(self, uri, **options):
raise ConfigurationError("redis prerequisite not available") # pragma: no cover

parsed = urllib.parse.urlparse(uri)
self.sentinel_configuration = []
sentinel_configuration = []
for loc in parsed.netloc.split(","):
host, port = loc.split(":")
self.sentinel_configuration.append((host, int(port)))
sentinel_configuration.append((host, int(port)))
self.service_name = (
parsed.path.replace("/", "") if parsed.path
else options.get("service_name", None)
)
if self.service_name is None:
raise ConfigurationError("'service_name' not provided")
self.sentinel = get_dependency("redis.sentinel").Sentinel(
self.sentinel_configuration,
sentinel_configuration,
socket_timeout=options.get("socket_timeout", 0.2)
)
self.initialize_storage()
Expand Down

0 comments on commit 97eacad

Please sign in to comment.