Skip to content

Commit

Permalink
allow ssl to be enabled for redis
Browse files Browse the repository at this point in the history
  • Loading branch information
pimbeenes committed Jun 9, 2022
1 parent 020908b commit 26c6cc9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dogpile/cache/backends/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ def __init__(self, arguments):
self.db = arguments.pop("db", 0)
self.distributed_lock = arguments.get("distributed_lock", False)
self.socket_timeout = arguments.pop("socket_timeout", None)

self.lock_timeout = arguments.get("lock_timeout", None)
self.lock_sleep = arguments.get("lock_sleep", 0.1)
self.thread_local_lock = arguments.get("thread_local_lock", True)
self.ssl = arguments.pop("ssl", False)

if self.distributed_lock and self.thread_local_lock:
warnings.warn(
Expand Down Expand Up @@ -134,6 +134,9 @@ def _create_client(self):
if self.socket_timeout:
args["socket_timeout"] = self.socket_timeout

if self.ssl:
args["ssl"] = self.ssl

if self.url is not None:
args.update(url=self.url)
self.writer_client = redis.StrictRedis.from_url(**args)
Expand Down

0 comments on commit 26c6cc9

Please sign in to comment.